2016-06-16 23:09:34 +05:30
|
|
|
# rubocop:disable all
|
2014-09-02 18:07:02 +05:30
|
|
|
class ConvertBlockedToState < ActiveRecord::Migration
|
|
|
|
def up
|
|
|
|
User.transaction do
|
|
|
|
User.where(blocked: true).update_all(state: :blocked)
|
|
|
|
User.where(blocked: false).update_all(state: :active)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
|
|
|
User.transaction do
|
|
|
|
User.where(state: :blocked).update_all(blocked: :true)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|