Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [1] pry(main)> nesting
- Nesting status:
- --
- 0. main (Pry top level)
- [2] pry(main)> post = Post.first
- Post Load (2.4ms) SELECT "posts".* FROM "posts" ORDER BY "posts"."id" ASC LIMIT ? [["LIMIT", 1]]
- => #<Post:0x007fe25e42b178
- id: 1,
- title: "First Post",
- body: "This is the first post in our system",
- created_at: Mon, 12 Mar 2018 02:03:24 UTC +00:00,
- updated_at: Mon, 12 Mar 2018 02:03:24 UTC +00:00>
- [3] pry(main)> cd post
- [4] pry(#<Post>):1> nesting
- Nesting status:
- --
- 0. main (Pry top level)
- 1. #<Post>
- [5] pry(#<Post>):1> self.to_s
- => "#<Post:0x007fe25e42b178>"
- [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.save!
- (0.2ms) begin transaction
- SQL (10.5ms) UPDATE "posts" SET "title" = ?, "body" = ?, "updated_at" = ? WHERE "posts"."id" = ? [["title", "some new title"], ["body", "some new body"], ["updated_at", "2018-03-12 02:32:38.021196"], ["id", 1]]
- (13.4ms) commit transaction
- => true
Add Comment
Please, Sign In to add comment