daily pastebin goal
26%
SHARE
TWEET

Untitled

a guest Dec 7th, 2017 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [5] pry(#<Post>):1> nesting
  2. Nesting status:
  3. --
  4. 0. main (Pry top level)
  5. 1. #<Post>
  6. [6] pry(#<Post>):1> self_to.s
  7. NameError: undefined local variable or method `self_to' for #<Post:0x00007ff13cf2f0c8>
  8. from /usr/local/lib/ruby/gems/2.4.0/gems/activemodel-5.1.4/lib/active_model/attribute_methods.rb:432:in `method_missing'
  9. [7] pry(#<Post>):1> self.to_s
  10. => "#<Post:0x00007ff13cf2f0c8>"
  11. [8] pry(#<Post>):1> self.title = 'some new title'
  12. => "some new title"
  13. [9] pry(#<Post>):1> self.body = 'some new body'
  14. => "some new body"
  15. [10] pry(#<Post>):1> self.changes
  16. => {"title"=>["First Post", "some new title"], "body"=>["This is the first post in our system", "some new body"]}
  17. [11] pry(#<Post>):1> self.save!
  18.    (0.1ms)  begin transaction
  19.   SQL (0.8ms)  UPDATE "posts" SET "title" = ?, "body" = ?, "updated_at" = ? WHERE "posts"."id" = ?  [["title", "some new title"], ["body", "some new body"], ["updated_at", "2017-12-04 23:55:09.076465"], ["id", 1]]
  20.    (6.8ms)  commit transaction
  21. => true
RAW Paste Data
Top