Advertisement
Guest User

Untitled

a guest
Apr 28th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. [6] pry(#<Post>):1> nesting
  2. Nesting status:
  3. --
  4. 0. main (Pry top level)
  5. 1. #<Post>
  6. [7] pry(#<Post>):1> self.to_s
  7. => "#<Post:0x00000001cb1fa0>"
  8. [8] pry(#<Post>):1> self.title = "title"
  9. => "title"
  10. [9] pry(#<Post>):1> self.boy = "body"
  11. NoMethodError: undefined method `boy=' for #<Post:0x00000001cb1fa0>
  12. Did you mean? body=
  13. from /usr/local/rvm/gems/ruby-2.3.0/gems/activemodel-4.2.5/lib/active_model/attribute_methods.rb:433:in `method_missing'
  14. [10] pry(#<Post>):1> self.body = "body"
  15. => "body"
  16. [11] pry(#<Post>):1> self.changes
  17. => {"title"=>["First", "title"],
  18. "body"=>["post", "body"]}
  19. [12] pry(#<Post>):1> self.save!
  20. (0.1ms) begin transaction
  21. SQL (0.6ms) UPDATE "posts" SET "title" = ?, "body" = ?, "updated_at" = ? WHERE "posts"."id" = ? [["title", "title"], ["body", "body"], ["updated_at", "2017-04-28 23:45:31.370880"], ["id", 1]]
  22. (13.1ms) commit transaction
  23. => true
  24. [13] pry(#<Post>):1>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement