State machine 3
Created by: Andrew8xx8
I have deleted block
field in User model, and added state field instead of it
Merge request reports
Activity
1 class ConvertBlockedToState < ActiveRecord::Migration 2 def up 3 User.transaction do 4 User.where(blocked: true).update_all(state: :blocked) 5 User.where(blocked: false).update_all(state: :active) 6 end 7 end 8 9 def down 10 User.transaction do 11 User.where(state: :blocked).update_all(blocked: :true)
Please register or sign in to reply