active_admin_paranoia 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2de9b380c61b06c7d5fae83324238ab7c0dc3221
4
- data.tar.gz: fd675d9ae5beb4d75e0c15867d283baa1e6675b3
3
+ metadata.gz: db08e66a0e4b52383510e3f0ce6a94381df645b9
4
+ data.tar.gz: 0e4c34ab96c8b5b98ddcb7107bfe9c8009d7dbb2
5
5
  SHA512:
6
- metadata.gz: e136677207878aae8b5d5018235a327e969377e419dd9a78bf4b2a74b0901880bece6d9fb3b3b87e905b37057fd840ba5d48bd28581a224e92031d2ac563d5e9
7
- data.tar.gz: 14a0c898fe8bd7193a487fbf90c55ba1bc58fbe2f84fff1b2cb153ac2fbe1183964a769a0ba1a8c59c36482802861a8149d79501b5fc6fabc8b690fb2505871c
6
+ metadata.gz: 1a1b3ba4c598e0199a8102a8096117ec451a8f38e7447634eddaff03c283ce82796866b3da286821bf8792e384c3e63b395b03822285c909e4c10a928c657195
7
+ data.tar.gz: e0738b509197528440d388a0eea2bd157480eedb7e1a732e3854607fa9abbc1f1f58c7901ee01b8d04e5d1659d1072572ca155077edf2556baad382283a5cc15
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- # Specify your gem's dependencies in active_admin_paranoiaable.gemspec
3
+ # Specify your gem's dependencies in active_admin_paranoia.gemspec
4
4
  gemspec
@@ -17,4 +17,5 @@ en:
17
17
  one: "Successfully restored 1 %{model}"
18
18
  other: "Successfully restored %{count} %{plural_model}"
19
19
  archived: "Archived"
20
+ non_archived: "Non Archived"
20
21
  something_wrong: "Something went wrong. Please try again"
@@ -21,13 +21,11 @@ module ActiveAdminParanoia
21
21
  end
22
22
 
23
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|
24
- ids.each do |id|
25
- resource_class.to_s.camelize.constantize.restore(id)
26
- end
24
+ resource_class.to_s.camelize.constantize.restore(ids, recursive: true)
27
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)
28
26
  end
29
27
 
30
- scope :all, default: true
28
+ scope(I18n.t('active_admin_paranoia.non_archived'), default: true) { |scope| scope.unscoped.where(resource_class.to_s.camelize.constantize.paranoia_column => resource_class.to_s.camelize.constantize.paranoia_sentinel_value) }
31
29
  scope(I18n.t('active_admin_paranoia.archived')) { |scope| scope.unscoped.where.not(resource_class.to_s.camelize.constantize.paranoia_column => resource_class.to_s.camelize.constantize.paranoia_sentinel_value) }
32
30
  end
33
31
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveAdminParanoia
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_admin_paranoia
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miah Raihan Mahmud Arman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-22 00:00:00.000000000 Z
11
+ date: 2015-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails