Skip to content

Instantly share code, notes, and snippets.

@kef
Created March 24, 2011 01:21
Show Gist options
  • Save kef/884387 to your computer and use it in GitHub Desktop.
Save kef/884387 to your computer and use it in GitHub Desktop.
class MakeTheAuIssuesFree < ActiveRecord::Migration
def self.up
Issue.update_all("purchasable = false", "product_id ='theau'")
end
def self.down
Issue.update_all("purchasable = true", "product_id ='theau'")
end
end
@kef
Copy link
Author

kef commented Mar 24, 2011

Hash form is better:

Issue.update_all({:purchasable => false}, {:product_id => 'theau'})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment