Skip to content

Instantly share code, notes, and snippets.

@skippskipp
Created May 10, 2017 20:19
Show Gist options
  • Save skippskipp/0bdee2fe90a2f61f0f91dce5a51dfe99 to your computer and use it in GitHub Desktop.
Save skippskipp/0bdee2fe90a2f61f0f91dce5a51dfe99 to your computer and use it in GitHub Desktop.
bloccit-rails-console-assignment
[6] pry(#<Post>):1> nesting
Nesting status:
--
0. main (Pry top level)
1. #<Post>
[7] pry(#<Post>):1> self.to_s
=> "#<Post:0x007f9ac1a74f28>"
[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 (1.8ms) UPDATE "posts" SET "title" = ?, "body" = ?, "updated_at" = ? WHERE "posts"."id" = ? [["title", "some new title"], ["body", "some new body"], ["updated_at", "2017-05-10 20:16:16.905406"], ["id", 1]]
(0.9ms) commit transaction
=> true
[12] pry(#<Post>):1>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment