active_admin_paranoia 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_admin_paranoia/dsl.rb +3 -3
- data/lib/active_admin_paranoia/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2994687d6e87ebaf8843c98b0e0893d1447c5f1a
|
4
|
+
data.tar.gz: 66e8eb56e41ac53bda190b96b8a0322609d7b4fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a27d48f411629fd762e745d8fdaabd967fca036d62b59ecf202c46350c7740a4ec70ffa9f0484f44ec96010f9a83e6c3c08a9683b0742fc6935ec20be7d0aaf
|
7
|
+
data.tar.gz: 2d63627cb2d70ee8bf3c66d488cbd4447f1c10141d78a264b0562b79412e55a73d9dd373105c38e3947c71b729c37efdf1cb6c2e38a60c54510f5e2407d6661c
|
@@ -7,7 +7,7 @@ module ActiveAdminParanoia
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def action_methods
|
10
|
-
if params[:scope]
|
10
|
+
if params[:scope] == 'archived'
|
11
11
|
%w(index)
|
12
12
|
else
|
13
13
|
super
|
@@ -15,12 +15,12 @@ module ActiveAdminParanoia
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
-
batch_action :destroy, confirm: proc{ I18n.t('active_admin.batch_actions.delete_confirmation', plural_model: resource_class.to_s.downcase.pluralize) }, if: proc{ authorized?(ActiveAdmin::Auth::DESTROY, resource_class) && params[:scope]
|
18
|
+
batch_action :destroy, confirm: proc{ I18n.t('active_admin.batch_actions.delete_confirmation', plural_model: resource_class.to_s.downcase.pluralize) }, if: proc{ authorized?(ActiveAdmin::Auth::DESTROY, resource_class) && params[:scope] != 'archived' } do |ids|
|
19
19
|
resource_class.to_s.camelize.constantize.where(id: ids).destroy_all
|
20
20
|
redirect_to :back, notice: I18n.t('active_admin.batch_actions.succesfully_destroyed', count: ids.count, model: resource_class.to_s.camelize.constantize.model_name, plural_model: resource_class.to_s.downcase.pluralize)
|
21
21
|
end
|
22
22
|
|
23
|
-
batch_action :restore, confirm: proc{ I18n.t('active_admin_paranoia.batch_actions.restore_confirmation', plural_model: resource_class.to_s.downcase.pluralize) }, if: proc{ authorized?(ActiveAdminParanoia::Auth::RESTORE, resource_class) && params[:scope]
|
23
|
+
batch_action :restore, confirm: proc{ I18n.t('active_admin_paranoia.batch_actions.restore_confirmation', plural_model: resource_class.to_s.downcase.pluralize) }, if: proc{ authorized?(ActiveAdminParanoia::Auth::RESTORE, resource_class) && params[:scope] == 'archived' } do |ids|
|
24
24
|
resource_class.to_s.camelize.constantize.restore(ids, recursive: true)
|
25
25
|
redirect_to :back, notice: I18n.t('active_admin_paranoia.batch_actions.succesfully_restored', count: ids.count, model: resource_class.to_s.camelize.constantize.model_name, plural_model: resource_class.to_s.downcase.pluralize)
|
26
26
|
end
|