Multipluck
Multipluck is a Ruby gem for Rails that enhances the .pluck function to select multiple columns.
Currently limited to Rails 3.2.3+, but I plan to change that.
Usage
# Fetch all user ids and names
User.pluck([:id, :name])
# => [ [1, "Bob"], [2, "Simone"], ... ]
Installation
- Add the gem to your Gemfile
gem 'multipluck'
- Pluck forth!
This project rocks and uses MIT-LICENSE. Yes it does.