Skip to content

Commit

Permalink
fix import preview
Browse files Browse the repository at this point in the history
* fix policy
* fix redirect
  • Loading branch information
senid231 committed Dec 11, 2019
1 parent f1a6829 commit fad3abb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/policies/role_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ def perform?
alias_rule :import?, to: :perform? # ActiveAdminImport::Auth::IMPORT
alias_rule :do_import?, to: :import? # active_admin_import

alias_rule :batch_insert?, :batch_replace?, :batch_update?, :delete_all?,
to: :perform?

private

# action could be one of [:read, :change, :remove, :perform]
Expand Down
2 changes: 1 addition & 1 deletion lib/resource_dsl/acts_as_import_preview.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def acts_as_import_preview
scope :for_update

redirect_proc = proc do
active_admin_config.namespace.resource_for(config.resource_class.import_class).route_collection_path
active_admin_config.namespace.resource_for(active_admin_config.resource_class.import_class).route_collection_path
end

acts_as_import_resource_class = config.resource_class
Expand Down

0 comments on commit fad3abb

Please sign in to comment.