![# db/migrate/20220226153929_create_orders.rb
class CreateOrders < ActiveRecord::Migration[7.0]
def change
create_table :orders do |t|
t.integer :subtotal_cents
t.integer :tax_cents
t.virtual :total_cents, type: :integer, as: "subtotal_cents + tax_cents", stored: true
t.timestamps
end
end
end
# console
Order.create(subtotal_cents: 1000, tax_cents: 200)
Order.last.total_ce...](https://pbs.twimg.com/media/FNGAInSVgAMi-za.jpg?name=small&format=webp)
ALT # db/migrate/20220226153929_create_orders.rb class CreateOrders < ActiveRecord::Migration[7.0] def change create_table :orders do |t| t.integer :subtotal_cents t.integer :tax_cents t.virtual :total_cents, type: :integer, as: "subtotal_cents + tax_cents", stored: true t.timestamps end end end # console Order.create(subtotal_cents: 1000, tax_cents: 200) Order.last.total_ce...

ALT # config/application.rb config.active_record.async_query_executor = :global_thread_pool # :multi_thread_pool executor can be used if you have multiple databases # app/controllers/dashboards_controller.rb class DashboardsController < ApplicationController def show # These queries will all run asynchronously # instead of running one by one @posts = Post.limit(500).load_async @users = User.limit(50...

ALT A website usually uses external resources like images, CSS, and JavaScript. Those files need to be loaded from network or cache. The main thread could request them one by one as they find them while parsing to build a DOM, but in order to speed up, "preload scanner" is run concurrently. If there are things like <img> or <link> in the HTML document, preload scanner peeks at tokens generated by HTML parser and sends requests to the network thread in the browser process.

ALT The new Firefox DevTools Compatibility panel in the inspector. A "selected element" group has a "scrollbar-color" item. On the right, Chrome, Safari, Edge and Internet Explorer icons are displayed. A tooltip is displayed with the following message: "Compatibility issues in: Chrome 97 (current)\nChrome 98 (beta)\nChrome 99 (nightly)\nChrome Android 97 (current)" and so on, with all the browsers not supporting scrollbar-color























![class CreateEvents < ActiveRecord::Migration[6.1]
def change
create_table :events do |t|
t.string :name
t.interval :duration
t.timestamps
end
end
end](https://pbs.twimg.com/media/FK16ZFRVQAIQhKE.jpg?name=small&format=webp)

