pluck(*column_names)
Instance Public methods
Use pluck as a shortcut to select one or more attributes
without loading a bunch of records just to grab the attributes you want.
Person.pluck(:name)
instead of
Person.all.map(&:name)
Pluck returns an Array of attribute values type-casted to
match the plucked column names, if they can be deduced. Plucking an SQL
fragment returns String values by default.
Person.pluck(:id)
# SELECT people.id FROM people
# => [1, 2, 3]
Person.plu