Created
October 30, 2012 02:01
-
-
Save abrongersma/3977879 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
1.9.3p125 :001 > u = User.first | |
User Load (0.6ms) SELECT "users".* FROM "users" LIMIT 1 | |
=> #<User id: 1, name: "aaron", age: nil, email: nil, username: nil, password: nil, created_at: "2012-10-30 01:39:34", updated_at: "2012-10-30 01:39:34"> | |
1.9.3p125 :002 > u.bumps | |
Bump Load (0.6ms) SELECT "bumps".* FROM "bumps" WHERE "bumps"."user_id" = 1 | |
=> [#<Bump id: 1, post_id: 1, user_id: 1, bumped_id: nil, created_at: "2012-10-30 01:53:13", updated_at: "2012-10-30 01:53:13">] | |
1.9.3p125 :003 > p = Post.first | |
Post Load (0.5ms) SELECT "posts".* FROM "posts" LIMIT 1 | |
=> #<Post id: 1, body: nil, reading_id: nil, user_id: 1, created_at: "2012-10-30 01:46:34", updated_at: "2012-10-30 01:46:34"> | |
1.9.3p125 :004 > p.bumps | |
Bump Load (0.3ms) SELECT "bumps".* FROM "bumps" WHERE "bumps"."post_id" = 1 | |
=> [#<Bump id: 1, post_id: 1, user_id: 1, bumped_id: nil, created_at: "2012-10-30 01:53:13", updated_at: "2012-10-30 01:53:13">] | |
1.9.3p125 :005 > u.posts | |
Post Load (0.3ms) SELECT "posts".* FROM "posts" WHERE "posts"."user_id" = 1 | |
=> [#<Post id: 1, body: nil, reading_id: nil, user_id: 1, created_at: "2012-10-30 01:46:34", updated_at: "2012-10-30 01:46:34">] | |
1.9.3p125 :006 > |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment