Skip to content

Instantly share code, notes, and snippets.

@fcarlone
Created February 17, 2017 01:16
Show Gist options
  • Save fcarlone/7333f367954bd721cbacd9b8328d9e03 to your computer and use it in GitHub Desktop.
Save fcarlone/7333f367954bd721cbacd9b8328d9e03 to your computer and use it in GitHub Desktop.
Bloc: bloccit - Assignment 16
[4] pry(#<Post>):1> nesting
Nesting status:
--
0. main (Pry top level)
1. #<Post>
[5] pry(#<Post>):1> self.to_s
=> "#<Post:0x007f8bc222b398>"
[6] pry(#<Post>):1> self.title = 'some new title'
=> "some new title"
[7] pry(#<Post>):1> self.body = 'some new body'
=> "some new body"
[8] pry(#<Post>):1> self.changes
=> {"title"=>["My first title", "some new title"], "body"=>["My first body for post_1", "some new body"]}
[9] pry(#<Post>):1> self.save!
(0.1ms) begin transaction
SQL (0.4ms) UPDATE "posts" SET "title" = ?, "body" = ?, "updated_at" = ? WHERE "posts"."id" = ? [["title", "some new title"], ["body", "some new body"], ["updated_at", "2017-02-17 01:10:56.960715"], ["id", 1]]
(1.8ms) commit transaction
=> true
[10] pry(#<Post>):1>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment