Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Jakes-MacBook-Pro:bloccit Jake$ rails c
- Loading development environment (Rails 4.2.5)
- [1] pry(main)> post = Post.first
- Post Load (0.1ms) SELECT "posts".* FROM "posts" ORDER BY "posts"."id" ASC LIMIT 1
- => #<Post:0x007f9f31031740
- id: 1,
- title: "First Post",
- body: "This is the first post in our system",
- created_at: Fri, 05 Feb 2016 08:23:36 UTC +00:00,
- updated_at: Fri, 05 Feb 2016 08:23:36 UTC +00:00>
- [2] pry(main)> nesting
- Nesting status:
- --
- 0. main (Pry top level)
- [3] pry(main)> self
- => main
- [4] pry(main)> self.title.coding
- NoMethodError: undefined method `title' for main:Object
- from (pry):3:in `__pry__'
- [5] pry(main)> self.title = "Welcome to Bloccit!"
- NoMethodError: undefined method `title=' for main:Object
- from (pry):4:in `__pry__'
- [6] pry(main)> cd Post.first
- Post Load (0.2ms) SELECT "posts".* FROM "posts" ORDER BY "posts"."id" ASC LIMIT 1
- [7] pry(#<Post>):1> nesting
- Nesting status:
- --
- 0. main (Pry top level)
- 1. #<Post>
- [8] pry(#<Post>):1> self.title = "welcome to bloccit"
- => "welcome to bloccit"
- [9] pry(#<Post>):1> self.body = "the body goes here"
- => "the body goes here"
- [10] pry(#<Post>):1> save!
- (0.2ms) begin transaction
- SQL (0.4ms) UPDATE "posts" SET "title" = ?, "body" = ?, "updated_at" = ? WHERE "posts"."id" = ? [["title", "welcome to bloccit"], ["body", "the body goes here"], ["updated_at", "2016-02-06 01:39:49.000350"], ["id", 1]]
- (0.7ms) commit transaction
- => true
- [11] pry(#<Post>):1> self
- => #<Post:0x007f9f306d99e0
- id: 1,
- title: "welcome to bloccit",
- body: "the body goes here",
- created_at: Fri, 05 Feb 2016 08:23:36 UTC +00:00,
- updated_at: Sat, 06 Feb 2016 01:39:49 UTC +00:00>
- [12] pry(#<Post>):1>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement