class ActiveAdmin::Exportable::Engine

Public Instance Methods

import_options() click to toggle source
# File lib/active_admin/exportable/engine.rb, line 13
def import_options
  allow_update = ActiveModel::Type::Boolean.new.cast(params[:import][:allow_update])
  file_path = params[:import][:file]&.path
  format = params[:import][:format]
  raise 'Format is required.' if format.blank?
  raise 'File is required.' if file_path.blank?

  { path: file_path, format: format, allow_update: allow_update }
end