Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- irb(main):001:0> @user = User.find(1)
- (0.1ms) SHOW search_path
- User Load (20.8ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 1]]
- => #<User id: 1, email: "alter.pub@gmail.com", encrypted_password: "$2a$10$yyhcHMVxDu1OYLZyafChReVF1cB8ASiXp9MQH4aPC3hJ...", reset_password_token: nil, reset_password_sent_at: nil, remember_created_at: nil, sign_in_count: 25, current_sign_in_at: "2011-12-27 07:55:16", last_sign_in_at: "2011-12-26 13:17:20", current_sign_in_ip: "195.218.191.171", last_sign_in_ip: "195.218.191.171", created_at: "2011-12-24 17:24:10", updated_at: "2011-12-27 07:55:16">
- irb(main):002:0> @wish = @user.wish_lists.build(:content => "hehe")
- => #<WishList id: nil, user_id: 1, content: "hehe", created_at: nil, updated_at: nil>
- irb(main):003:0> @wish.save
- (0.2ms) BEGIN
- SQL (6.1ms) INSERT INTO "wish_lists" ("content", "created_at", "updated_at", "user_id") VALUES ($1, $2, $3, $4) RETURNING "id" [["content", "hehe"], ["created_at", Tue, 27 Dec 2011 09:21:22 UTC +00:00], ["updated_at", Tue, 27 Dec 2011 09:21:22 UTC +00:00], ["user_id", 1]]
- (0.9ms) COMMIT
- => true
Add Comment
Please, Sign In to add comment