Guest User

Untitled

a guest
May 10th, 2018
382
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rails 1.11 KB | None | 0 0
  1. irb(main):001:0> @user = User.find(1)
  2.    (0.1ms)  SHOW search_path
  3.   User Load (20.8ms)  SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1  [["id", 1]]
  4. => #<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">
  5.  
  6. irb(main):002:0> @wish = @user.wish_lists.build(:content => "hehe")
  7. => #<WishList id: nil, user_id: 1, content: "hehe", created_at: nil, updated_at: nil>
  8.  
  9. irb(main):003:0> @wish.save
  10.    (0.2ms)  BEGIN
  11.   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]]
  12.    (0.9ms)  COMMIT
  13. => true
Add Comment
Please, Sign In to add comment