Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [6] pry(#<Post>):1> nesting
- Nesting status:
- --
- 0. main (Pry top level)
- 1. #<Post>
- [7] pry(#<Post>):1> self.to_s
- => "#<Post:0x00000001cb1fa0>"
- [8] pry(#<Post>):1> self.title = "title"
- => "title"
- [9] pry(#<Post>):1> self.boy = "body"
- NoMethodError: undefined method `boy=' for #<Post:0x00000001cb1fa0>
- Did you mean? body=
- from /usr/local/rvm/gems/ruby-2.3.0/gems/activemodel-4.2.5/lib/active_model/attribute_methods.rb:433:in `method_missing'
- [10] pry(#<Post>):1> self.body = "body"
- => "body"
- [11] pry(#<Post>):1> self.changes
- => {"title"=>["First", "title"],
- "body"=>["post", "body"]}
- [12] pry(#<Post>):1> self.save!
- (0.1ms) begin transaction
- 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]]
- (13.1ms) commit transaction
- => true
- [13] pry(#<Post>):1>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement