Guest User

Untitled

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