Skip to content

Instantly share code, notes, and snippets.

@BethKnight1234
Created April 15, 2016 20:26
Show Gist options
  • Save BethKnight1234/f308a0792e3acd9a8320d22f536c5841 to your computer and use it in GitHub Desktop.
Save BethKnight1234/f308a0792e3acd9a8320d22f536c5841 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment