Skip to content

Instantly share code, notes, and snippets.

@levycarneiro
Created November 23, 2009 16:56
Show Gist options
  • Save levycarneiro/241178 to your computer and use it in GitHub Desktop.
Save levycarneiro/241178 to your computer and use it in GitHub Desktop.
# Converting a general MySQL query...
UPDATE `jos_content` SET checked_out = 62, checked_out_time = '2009-11-23 13:09:46' WHERE id = '179'
# ...into a Rails Migration
class Migration20091123001 < ActiveRecord::Migration
def self.up
item = JosContent.find(179)
item.checked_out = 62
item.checked_out_time = '2009-11-23 13:09:46'
item.save!
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment