Skip to content

Instantly share code, notes, and snippets.

@rodrei
Created September 12, 2012 13:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rodrei/3706509 to your computer and use it in GitHub Desktop.
Save rodrei/3706509 to your computer and use it in GitHub Desktop.
Migration
Call.where(:state.in => [:to_bill, :free]).all.each do |c|
c.billing_state = c.state
c.state = :scheduled
c.save!
end
Call.where(:billing_state => nil).each do |c|
c.update_attributes!(:billing_state => "unprocessed")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment