From fad3abb6b8a128a440195c3f362c48e6e8791f20 Mon Sep 17 00:00:00 2001 From: Denis Talakevich Date: Tue, 10 Dec 2019 21:24:31 +0200 Subject: [PATCH] fix import preview * fix policy * fix redirect --- app/policies/role_policy.rb | 3 +++ lib/resource_dsl/acts_as_import_preview.rb | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/policies/role_policy.rb b/app/policies/role_policy.rb index 3eebd8191..512c93fda 100644 --- a/app/policies/role_policy.rb +++ b/app/policies/role_policy.rb @@ -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] diff --git a/lib/resource_dsl/acts_as_import_preview.rb b/lib/resource_dsl/acts_as_import_preview.rb index 2c02ab8c4..1cb4e221c 100644 --- a/lib/resource_dsl/acts_as_import_preview.rb +++ b/lib/resource_dsl/acts_as_import_preview.rb @@ -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