Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. [5] pry(#<Post>):1> nesting
  2. Nesting status:
  3. --
  4. 0. main (Pry top level)
  5. 1. #<Post>
  6.  
  7. [6] pry(#<Post>):1> self.to_s
  8. => "#<Post:0x007fa97d2e3528>"
  9.  
  10. [7] pry(#<Post>):1> self.title = 'some new title'
  11. => "some new title"
  12.  
  13. [8] pry(#<Post>):1> self.body = 'some new body'
  14. => "some new body"
  15.  
  16. [9] pry(#<Post>):1> self.changes
  17. => {"title"=>["First Post", "some new title"],
  18. "body"=>["This is the first post in our system", "some new body"]}
  19.  
  20. [10] pry(#<Post>):1> self.save!
  21. (0.1ms) begin transaction
  22. SQL (0.5ms) UPDATE "posts" SET "title" = ?, "body" = ?, "updated_at" = ? WHERE "posts"."id" = ? [["title", "some new title"], ["body", "some new body"], ["updated_at", 2017-01-23 22:52:10 UTC], ["id", 1]]
  23. (0.5ms) commit transaction
  24. => true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement