lib/typus/controller/format.rb in typus-3.1.5 vs lib/typus/controller/format.rb in typus-3.1.6
- old
+ new
@@ -25,10 +25,10 @@
filename = Rails.root.join("tmp", "export-#{@resource.to_resource}-#{Time.zone.now.to_s(:number)}.csv")
options = { :conditions => @conditions, :batch_size => 1000 }
::CSV.open(filename, 'w') do |csv|
- csv << fields.keys
+ csv << fields.keys.map { |k| @resource.human_attribute_name(k) }
@resource.find_in_batches(options) do |records|
records.each do |record|
csv << fields.map do |key, value|
case value
when :transversal