Created
April 15, 2016 20:25
-
-
Save BethKnight1234/b17d6e6dda497d2a370254ccf8e4a6f6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Beths-MacBook-Pro:~ bethknight$ cd development | |
Beths-MacBook-Pro:development bethknight$ cd code | |
Beths-MacBook-Pro:code bethknight$ cd bloccit | |
Beths-MacBook-Pro:bloccit bethknight$ nesting | |
-bash: nesting: command not found | |
Beths-MacBook-Pro:bloccit bethknight$ rails c | |
Loading development environment (Rails 4.2.5) | |
[1] pry(main)> nesting | |
Nesting status: | |
-- | |
0. main (Pry top level) | |
[2] pry(main)> cd Post.first | |
Post Load (0.6ms) SELECT "posts".* FROM "posts" ORDER BY "posts"."id" ASC LIMIT 1 | |
[3] pry(#<Post>):1> nesting | |
Nesting status: | |
-- | |
0. main (Pry top level) | |
1. #<Post> | |
[4] pry(#<Post>):1> self.title = "New title" | |
=> "New title" | |
[5] pry(#<Post>):1> self.body = "New body" | |
=> "New body" | |
[6] pry(#<Post>):1> save! | |
(0.1ms) begin transaction | |
SQL (0.3ms) UPDATE "posts" SET "title" = ?, "body" = ?, "updated_at" = ? WHERE "posts"."id" = ? [["title", "New title"], ["body", "New body"], ["updated_at", "2016-04-15 20:22:20.149560"], ["id", 1]] | |
(0.6ms) commit transaction | |
=> true | |
[7] pry(#<Post>):1> self | |
=> #<Post:0x007fbc32da3c48 | |
id: 1, | |
title: "New title", | |
body: "New body", | |
created_at: Fri, 15 Apr 2016 19:47:14 UTC +00:00, | |
updated_at: Fri, 15 Apr 2016 20:22:20 UTC +00:00> | |
[8] pry(#<Post>):1> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment