mastodon/db/migrate/20171026200500_en_to_en_cy.rb

18 lines
309 B
Ruby

class EnToEnCy < ActiveRecord::Migration[5.1]
def up
User.find_each do |user|
if user.locale == 'en'
user.update(locale: 'en-CY')
end
end
end
def down
User.find_each do |user|
if user.locale == 'en-CY'
user.update(locale: 'en')
end
end
end
end