active_admin_paranoia 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4ddd78aadc071c7c37f88c1c8e175a69b026063d
4
- data.tar.gz: 527fc3e612ac6a8b1ee8ada7945052e228917931
3
+ metadata.gz: 2994687d6e87ebaf8843c98b0e0893d1447c5f1a
4
+ data.tar.gz: 66e8eb56e41ac53bda190b96b8a0322609d7b4fa
5
5
  SHA512:
6
- metadata.gz: db36375af5ce22b40c8eea7a315cb0c926e6eb249252f8f5408cb9b6cea1a9334d960aa0d9d646bbd7f622036b46e6f3ab78791ad749a10affdaa93967638f4b
7
- data.tar.gz: 19ddcf882f57458b12bb9d78c71bdac99a03e3593a1a78b592bb64c119c0e378ee46d9166dea768b1cf8e2f7bed5c7aee57cfcb76595ace6f71b749e3c93b7b1
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].present? && params[:scope] == 'archived'
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].present? && params[:scope] != 'archived' } do |ids|
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].present? && params[:scope] == 'archived' } do |ids|
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
@@ -1,3 +1,3 @@
1
1
  module ActiveAdminParanoia
2
- VERSION = '1.0.3'
2
+ VERSION = '1.0.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_admin_paranoia
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miah Raihan Mahmud Arman