scinote-web/db/migrate/20180905142400_add_tooltips_enabled_to_user_settings.rb

15 lines
305 B
Ruby

class AddTooltipsEnabledToUserSettings < ActiveRecord::Migration[5.1]
def up
User.find_each do |user|
user.settings[:tooltips_enabled] = true
user.save
end
end
def down
User.find_each do |user|
user.settings.delete(:tooltips_enabled)
user.save
end
end
end