2013-03-04 15:51:00 +01:00
|
|
|
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
|
2013-03-05 11:29:44 +01:00
|
|
|
User.where(state: :blocked).update_all(blocked: :true)
|
2013-03-04 15:51:00 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|