Module: TheForce::ActiveRecordSupport::InstanceMethods
- Included in:
- Object
- Defined in:
- lib/the_force/rails_support.rb
Instance Method Summary collapse
Instance Method Details
#collect_column(column_name, conditions = {}) ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/the_force/rails_support.rb', line 4 def collect_column(column_name, conditions = {}) collection = [] column_name = column_name.to_s self.find_each(:select => column_name, :conditions => conditions) do |record| collection << record.attributes[column_name] end collection end |