vendor/plugins/ar-extensions-0.7.0a/lib/ar-extensions/csv.rb
# Returns CSV data with headers for an array of ActiveRecord::Base
# model objects by iterating over them and calling to_csv with
# the passed in +options+.
Returns CSV data with headers for an array of ActiveRecord::Base
model objects by iterating over them and calling to_csv with
the passed in +options+.
Returns CSV data with headers for an array of ActiveRecord :: Base model objects by iterating over them and calling to_csv with the passed in + options + .
def to_csv( options={} )
      FasterCSV.generate do |csv|
        headers = to_csv_headers( options )
        csv << headers if headers
        each do |model_instance| 
          model_instance.to_csv_data( options ).each{ |data| csv << data }
        end
      end
    end
def to_csv ( options = { } ) FasterCSV . generate do | csv | headers = to_csv_headers ( options ) csv << headers if headers each do | model_instance | model_instance . to_csv_data ( options ) . each { | data | csv << data } end end end
Returns CSV data with headers for an array of ActiveRecord::Base
model objects by iterating over them and calling to_csv with
the passed in +options+.
Returns CSV data with headers for an array of ActiveRecord :: Base model objects by iterating over them and calling to_csv with the passed in + options + .
options
<not_specific>