Skip to content

Instantly share code, notes, and snippets.

@ethan021021
Created February 12, 2017 07:02
Show Gist options
  • Save ethan021021/d4e8d05e65c58029b262a11781a75fbb to your computer and use it in GitHub Desktop.
Save ethan021021/d4e8d05e65c58029b262a11781a75fbb to your computer and use it in GitHub Desktop.
[5] pry(#<Post>):1> nesting
Nesting status:
--
0. main (Pry top level)
1. #<Post>
[6] pry(#<Post>):1> self.to_s
=> "#<Post:0x007fb4511e25c8>"
[7] pry(#<Post>):1> self.title = 'some new title'
=> "some new title"
[8] pry(#<Post>):1> self.body = 'some new body'
=> "some new body"
[9] pry(#<Post>):1> self.changes
=> {"title"=>["First Post", "some new title"],
"body"=>["This is the first post in our system", "some new body"]}
[10] pry(#<Post>):1> self.save!
(0.1ms) begin transaction
SQL (0.5ms) UPDATE "posts" SET "title" = ?, "body" = ?, "updated_a
t" = ? WHERE "posts"."id" = ? [["title", "some new title"], ["body",
"some new body"], ["updated_at", "2017-02-12 07:00:53.564972"], ["id
", 1]]
(0.7ms) commit transaction
=> true
[11] pry(#<Post>):1>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment