Skip to content

Instantly share code, notes, and snippets.

@mrbrdo
Created December 8, 2014 20:34
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 mrbrdo/b90781802ef60cac9f70 to your computer and use it in GitHub Desktop.
Save mrbrdo/b90781802ef60cac9f70 to your computer and use it in GitHub Desktop.
User.select_map(:id)
# => [2]
User.select_map([:id, :email])
# => [[2, "user@example.com"]]
User.select_hash(:id, :email)
# => {2=>"user@example.com"}
User.select(:id, :email).naked.all
# => [{:id=>2, :email=>"user@example.com"}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment