Module: ActiveAdminImport::Options
- Defined in:
- lib/active_admin_import/options.rb
Constant Summary collapse
- VALID_OPTIONS =
[ :back, :csv_options, :validate, :batch_size, :batch_transaction, :before_import, :after_import, :before_batch_import, :after_batch_import, :on_duplicate_key_update, :timestamps, :ignore, :template, :template_object, :result_class, :resource_class, :resource_label, :plural_resource_label, :error_limit, :headers_rewrites, :if, :action_item_html_options ].freeze
Class Method Summary collapse
Class Method Details
.options_for(config, options = {}) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/active_admin_import/options.rb', line 29 def self.(config, = {}) unless .key? :template_object [:template_object] = -> { ActiveAdminImport::Model.new } end { back: { action: :import }, csv_options: {}, template: 'admin/import', resource_class: config.resource_class, resource_label: config.resource_label, plural_resource_label: config.plural_resource_label, error_limit: 5, headers_rewrites: {}, if: true, # AA 4's built-in action_items hardcode this class for Tailwind styling # (lib/active_admin/resource/action_items.rb). It's a no-op on AA 3. action_item_html_options: { class: 'action-item-button' } }.deep_merge() end |