Created
November 12, 2013 07:56
-
-
Save mindaslab/7427191 to your computer and use it in GitHub Desktop.
Saving a record without timestamps
This file contains hidden or 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
2.0.0-p247 :002 > t = Tweet.new | |
=> #<Tweet id: nil, content: nil> | |
2.0.0-p247 :003 > t.content = "Tweet without time" | |
=> "Tweet without time" | |
2.0.0-p247 :004 > t.save | |
(0.3ms) begin transaction | |
SQL (0.9ms) INSERT INTO "tweets" ("content") VALUES (?) [["content", "Tweet without time"]] | |
(190.3ms) commit transaction | |
=> true | |
2.0.0-p247 :005 > Tweet.all | |
Tweet Load (0.4ms) SELECT "tweets".* FROM "tweets" | |
=> #<ActiveRecord::Relation [#<Tweet id: 1, content: "Tweet without time">]> | |
2.0.0-p247 :006 > |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment