Skip to content

Instantly share code, notes, and snippets.

@mindaslab
Created November 12, 2013 07:56
Show Gist options
  • Save mindaslab/7427191 to your computer and use it in GitHub Desktop.
Save mindaslab/7427191 to your computer and use it in GitHub Desktop.
Saving a record without timestamps
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