migrate existing weight calculators

This commit is contained in:
Andy Brett
2020-09-12 12:32:06 -07:00
parent 4123eb7c10
commit 37cfe65688

View File

@@ -0,0 +1,10 @@
class UpdateWeightCalculators < ActiveRecord::Migration
def change
Calculator::Weight.each { |calculator|
calculator.preferred_unit_from_list = 'kg'
calculator.preferred_per_unit = calculator.preferred_per_kg
calculator.preferences.delete(:preferred_per_kg)
calculator.save
}
end
end