Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [5] pry(#<Post>):1> nesting
- Nesting status:
- --
- 0. main (Pry top level)
- 1. #<Post>
- [6] pry(#<Post>):1> self_to.s
- NameError: undefined local variable or method `self_to' for #<Post:0x00007ff13cf2f0c8>
- from /usr/local/lib/ruby/gems/2.4.0/gems/activemodel-5.1.4/lib/active_model/attribute_methods.rb:432:in `method_missing'
- [7] pry(#<Post>):1> self.to_s
- => "#<Post:0x00007ff13cf2f0c8>"
- [8] pry(#<Post>):1> self.title = 'some new title'
- => "some new title"
- [9] pry(#<Post>):1> self.body = 'some new body'
- => "some new body"
- [10] pry(#<Post>):1> self.changes
- => {"title"=>["First Post", "some new title"], "body"=>["This is the first post in our system", "some new body"]}
- [11] pry(#<Post>):1> self.save!
- (0.1ms) begin transaction
- 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]]
- (6.8ms) commit transaction
- => true
Add Comment
Please, Sign In to add comment