lib/active_admin/csv_builder.rb in activeadmin-1.0.0 vs lib/active_admin/csv_builder.rb in activeadmin-1.1.0
- old
+ new
@@ -28,25 +28,25 @@
attr_reader :columns, :options, :view_context
COLUMN_TRANSITIVE_OPTIONS = [:humanize_name].freeze
- def initialize(options={}, &block)
+ def initialize(options = {}, &block)
@resource = options.delete(:resource)
@columns, @options, @block = [], options, block
end
- def column(name, options={}, &block)
+ def column(name, options = {}, &block)
@columns << Column.new(name, @resource, column_transitive_options.merge(options), block)
end
def build(controller, csv)
@collection = controller.send :find_collection, except: :pagination
columns = exec_columns controller.view_context
options = ActiveAdmin.application.csv_options.merge self.options
bom = options.delete :byte_order_mark
column_names = options.delete(:column_names) { true }
- csv_options = options.except :encoding_options
+ csv_options = options.except :encoding_options, :humanize_name
csv << bom if bom
if column_names
csv << CSV.generate_line(columns.map{ |c| encode c.name, options }, csv_options)