Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Nesting status:
- --
- 0. main (Pry top level)
- [3] pry(main)> post = Post.first
- Post Load (0.0ms) SELECT "posts".* FROM "posts" ORDER BY "posts"."id" ASC LIMIT ? [["LIMIT", 1]]
- => #<Post:0x0000000008e38c28
- id: 1,
- title: "First Post",
- body: "This is the first post in our system",
- created_at: Mon, 01 Jan 2018 19:33:17 UTC +00:00,
- updated_at: Mon, 01 Jan 2018 19:33:17 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:0x0000000008e38c28>"
- [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!
- (1.0ms) begin transaction
- SQL (3.0ms) UPDATE "posts" SET "title" = ?, "body" = ?, "updated_at" = ? WHERE "posts"."id" = ? [["title", "some new title"], ["body", "some new body"], ["updated_
- at", "2018-01-01 20:00:18.336740"], ["id", 1]]
- (84.0ms) commit transaction
- => true
- [11] pry(#<Post>):1>
Add Comment
Please, Sign In to add comment