Project

mpluck

0.0
No commit activity in last 3 years
No release in over 3 years
multipluck helper for Rails 2 and 3
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

< 4.0, >= 2.0
~> 1.7
~> 10.0
 Project Readme

Mpluck

Simple AR patch to allow for easy multi-plucking in Rails 2 and 3. This does not use the code from Rails 4 and you have to explicitly call 'multipluck' or 'mpluck'. If you want to just call 'pluck' for Rails 4-like functionality, check out https://github.com/jzaleski/multipluck

Also adds helper method for grouping plucked results.

Installation

Add this line to your application's Gemfile:

gem 'mpluck'

And then execute:

$ bundle

Or install it yourself as:

$ gem install mpluck

Usage

$ Foo.where(bar: "baz").multipluck(:id, :qux, :woz)

also added a grouping option

 $ Foo.where(bar: "baz").grouped_multipluck(:id, [:qux, :woz])

:mpluck and :grouped_mpluck are respectively aliases for :multipluck and :grouped_mpluck

Contributing

  1. Fork it ( https://github.com/[my-github-username]/mpluck/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request