Created
February 15, 2014 16:04
-
-
Save jmcbri/9021337 to your computer and use it in GitHub Desktop.
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
Fresh app results: | |
dcid_2 $ rails c | |
Loading development environment (Rails 4.0.2) | |
irb(main):001:0> user = User.new(name: "", email: "[email protected]") | |
=> #<User id: nil, name: "", email: "[email protected]", citizen_number: nil, password: nil, created_at: nil, updated_at: nil> | |
irb(main):002:0> user.valid? | |
=> true | |
irb(main):003:0> user.name | |
=> "" | |
irb(main):004:0> user.name="Bob" | |
=> "Bob" | |
irb(main):005:0> user.name | |
=> "Bob" | |
irb(main):006:0> user.save | |
(0.1ms) begin transaction | |
SQL (2.2ms) INSERT INTO "users" ("created_at", "email", "name", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Sat, 15 Feb 2014 15:56:33 UTC +00:00], ["email", "[email protected]"], ["name", "Bob"], ["updated_at", Sat, 15 Feb 2014 15:56:33 UTC +00:00]] | |
(168.4ms) commit transaction | |
=> true | |
irb(main):007:0> user.reload | |
User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]] | |
=> #<User id: 1, name: "Bob", email: "[email protected]", citizen_number: nil, password: nil, created_at: "2014-02-15 15:56:33", updated_at: "2014-02-15 15:56:33"> | |
irb(main):008:0> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment