vendor/plugins/ar-extensions-0.7.0a/lib/ar-extensions/csv.rb
# Returns CSV data without any header rows for the passed in +options+.
Returns CSV data without any header rows for the passed in +options+.
Returns CSV data without any header rows for the passed in + options + .
def to_csv_data( options={} )
      fields = self.class.to_csv_fields( options ).fields
      data, model_data = [], fields.inject( [] ) { |arr,field| arr << attributes[field].to_s }
      if options[:include]
        to_csv_data_for_included_associations( options[:include ] ).map do |assoc_csv_data|
          data << model_data + assoc_csv_data
        end
      else
        data << model_data
      end
      data
    end
def to_csv_data ( options = { } ) fields = self . class . to_csv_fields ( options ) . fields data , model_data = [ ] , fields . inject ( [ ] ) { | arr , field | arr << attributes [ field ] . to_s } if options [ :include ] to_csv_data_for_included_associations ( options [ :include ] ) . map do | assoc_csv_data | data << model_data + assoc_csv_data end else data << model_data end data end
Returns CSV data without any header rows for the passed in +options+.
Returns CSV data without any header rows for the passed in + options + .
options
<not_specific>