Skip to content

Instantly share code, notes, and snippets.

@NaiyaShah-BTC
Created April 30, 2019 05:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NaiyaShah-BTC/e8a5afef368c587179ef2b102d6dfd86 to your computer and use it in GitHub Desktop.
Save NaiyaShah-BTC/e8a5afef368c587179ef2b102d6dfd86 to your computer and use it in GitHub Desktop.
User.limit(1).pluck(:name).first
# SELECT "users"."name" FROM "users" LIMIT ? [["LIMIT", 1]]
# => "David"
User.where(id: 1).pluck(:name).first
# SELECT "users"."name" FROM "users" WHERE "users"."id" = $1
# => "David"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment