vendor/plugins/ar-extensions-0.7.0a/lib/ar-extensions/csv.rb
# Returns an array of CSV headers passed in the array of +options+.
Returns an array of CSV headers passed in the array of +options+.
Returns an array of CSV headers passed in the array of + options + .
def to_csv_headers( options={} )
      options = { :headers=>true, :naming=>":header" }.merge( options )
      return nil if not options[:headers]
      fieldmap = to_csv_fields( options )
      headers = fieldmap.headers
      headers.push( *to_csv_headers_for_included_associations( options[ :include ] ).flatten )
      headers.map{ |header| options[:naming].gsub( /:header/, header ).gsub( /:model/, self.name.downcase ) }
    end
def to_csv_headers ( options = { } ) options = { :headers => true , :naming => ":header" } . merge ( options ) return nil if not options [ :headers ] fieldmap = to_csv_fields ( options ) headers = fieldmap . headers headers . push ( * to_csv_headers_for_included_associations ( options [ :include ] ) . flatten ) headers . map { | header | options [ :naming ] . gsub ( / :header / , header ) . gsub ( / :model / , self . name . downcase ) } end
Returns an array of CSV headers passed in the array of +options+.
Returns an array of CSV headers passed in the array of + options + .
options
<not_specific>