Created
November 23, 2009 16:56
-
-
Save levycarneiro/241178 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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