Skip to content

Instantly share code, notes, and snippets.

@jordanhudgens
Created March 17, 2018 16:36
Show Gist options
  • Save jordanhudgens/95a9b3fe6f77273f773a65240bb77d84 to your computer and use it in GitHub Desktop.
Save jordanhudgens/95a9b3fe6f77273f773a65240bb77d84 to your computer and use it in GitHub Desktop.
2.5.0 :005 > u
User Load (0.7ms) SELECT "users".* FROM "users" WHERE "users"."deleted_at" IS NULL ORDER BY "users"."id" DESC LIMIT $1 [["LIMIT", 1]]
=> #<User id: 513, email: "[email protected]", created_at: "2017-09-23 23:16:07", updated_at: "2017-09-23 23:16:08", full_name: "Jordan Hudgens", roles: nil, username: "jdhudgenasdfa", slug: "jdhudgenasdfa", deleted_at: nil, role: "standard_user", posts_count: 0>
2.5.0 :006 > u('[email protected]')
User Load (6.6ms) SELECT "users".* FROM "users" WHERE "users"."deleted_at" IS NULL AND "users"."email" = $1 LIMIT $2 [["email", "[email protected]"], ["LIMIT", 1]]
=> #<User id: 1, email: "[email protected]", created_at: "2017-07-11 01:39:44", updated_at: "2017-09-09 19:35:02", full_name: "Jordan Hudgens", roles: nil, username: "jordan", slug: "jordan", deleted_at: nil, role: "standard_user", posts_count: 107>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment