lib/active_admin/csv_builder.rb in activeadmin-2.2.0 vs lib/active_admin/csv_builder.rb in activeadmin-2.3.0
- old
+ new
@@ -31,21 +31,20 @@
COLUMN_TRANSITIVE_OPTIONS = [:humanize_name].freeze
def initialize(options = {}, &block)
@resource = options.delete(:resource)
@columns = []
- @options = options
+ @options = ActiveAdmin.application.csv_options.merge options
@block = block
end
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, :humanize_name
csv << bom if bom