Was curious if Rails supports database-generated columns: turns out, yes, as of Rails 7:
create_table :users do |t| t.numeric :height_cm t.virtual :height_in, type: :numeric, as: 'height_cm / 2.54', stored: true end
create_table :users do |t| t.numeric :height_cm t.virtual :height_in, type: :numeric, as: 'height_cm / 2.54', stored: true end