Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [2] pry(main)> nesting
- Nesting status:
- --
- 0. main (Pry top level)
- [3] pry(main)> post = Post.first
- Post Load (0.7ms) SELECT "posts".* FROM "posts" ORDER BY "posts"."id" ASC LIMIT 1
- => #<Post:0x007fc83bfcd4c8
- id: 1,
- title: "First Post",
- body: "This is the first post in our system",
- created_at: Wed, 29 Mar 2017 00:36:55 UTC +00:00,
- updated_at: Wed, 29 Mar 2017 00:36:55 UTC +00:00>
- [4] pry(main)> cd post
- [5] pry(#<Post>):1> nesting
- Nesting status:
- --
- 0. main (Pry top level)
- 1. #<Post>
- [6] pry(#<Post>):1> self.to_s
- => "#<Post:0x007fc83bfcd4c8>"
- [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!
- (4.3ms) begin transaction
- SQL (2.3ms) UPDATE "posts" SET "title" = ?, "body" = ?, "updated_at" = ? WHERE "posts"."id" = ? [["title", "some new title"], ["body", "some new body"], ["updated_at", "2017-03-29 19:20:55.648908"], ["id", 1]]
- (0.8ms) commit transaction
- => true
- [11] pry(#<Post>):1>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement