Multipluck
A Ruby gem for Rails that enhances the pluck
function to select multiple columns
Usage
# Fetch all user ids and names using var-args
User.pluck(:id, :name)
# => [[1, "Bob"], [2, "Simone"], ...]
# Fetch all user ids and names using an `Array` (legacy)
User.pluck([:id, :name])
# => [[1, "Bob"], [2, "Simone"], ...]
Contributing
- Fork it ( http://github.com/jzaleski/multipluck/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request