Guest User

Untitled

a guest
Jan 7th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. Nesting status:
  2. --
  3. 0. main (Pry top level)
  4. [3] pry(main)> post = Post.first
  5. Post Load (0.0ms) SELECT "posts".* FROM "posts" ORDER BY "posts"."id" ASC LIMIT ? [["LIMIT", 1]]
  6. => #<Post:0x0000000008e38c28
  7. id: 1,
  8. title: "First Post",
  9. body: "This is the first post in our system",
  10. created_at: Mon, 01 Jan 2018 19:33:17 UTC +00:00,
  11. updated_at: Mon, 01 Jan 2018 19:33:17 UTC +00:00>
  12. [4] pry(main)> cd post
  13. [5] pry(#<Post>):1> nesting
  14. Nesting status:
  15. --
  16. 0. main (Pry top level)
  17. 1. #<Post>
  18. [6] pry(#<Post>):1> self.to_s
  19. => "#<Post:0x0000000008e38c28>"
  20. [7] pry(#<Post>):1> self.title = 'some new title'
  21. => "some new title"
  22. [8] pry(#<Post>):1> self.body = 'some new body'
  23. => "some new body"
  24. [9] pry(#<Post>):1> self.changes
  25. => {"title"=>["First Post", "some new title"], "body"=>["This is the first post in our system", "some new body"]}
  26. [10] pry(#<Post>):1> self.save!
  27. (1.0ms) begin transaction
  28. SQL (3.0ms) UPDATE "posts" SET "title" = ?, "body" = ?, "updated_at" = ? WHERE "posts"."id" = ? [["title", "some new title"], ["body", "some new body"], ["updated_
  29. at", "2018-01-01 20:00:18.336740"], ["id", 1]]
  30. (84.0ms) commit transaction
  31. => true
  32. [11] pry(#<Post>):1>
Add Comment
Please, Sign In to add comment