active_admin_paranoia 1.0.9 → 1.0.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- YWI5MGIyM2JiNDQwMDA4NjA4Y2M2YjQzOTExMjM5YzMwYWVlYmY2OQ==
5
- data.tar.gz: !binary |-
6
- NTQ3NjYyM2YwMmUxYjM1OTEwNmU2OTU5NDgxZWU5MjhlNGVlZTAxZg==
2
+ SHA1:
3
+ metadata.gz: 90216d115aad9b5d601ab5a9ae4c3c890d41467f
4
+ data.tar.gz: a9e51b014d5e077cecb05fcb136a37396395c62d
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- OTc2ODIxMGRiYWNkZGM4OWJlZTE0NmFlODliODlkZmRhMmU0Y2QzMzEwZjNm
10
- NjY3M2NmMDc3NjZiMjQ4MjJlMjI1MTBjOGU0ODI0ZGE3NDFhYjIwYzQ3MGQy
11
- M2RmZTcyNTdmYTIwZDlhOTQ4NWNhODhiNGY1NTg2Mzg4NDNhMGI=
12
- data.tar.gz: !binary |-
13
- MGM2MmNjYTMyNjViMTFjYzdhM2VmODMxNGU2ZjYyYWU1MzdhZDMyOTI2NWVm
14
- NDVkY2Q2NzQ5MTVlZTljOGRjOWU5MTE4MGM1MGY1ODE0MWJiMmU4MGU4Nzgz
15
- NDQ1ZGJmNDVlOWI3MjYzZGFhODMxYzcwMWE5ODkxNzJkNTQxNzI=
6
+ metadata.gz: 4587181367aa4b8eb8f81037dfe2107f9e8a3e2bebe9b210bf4e4762a4aa6752565083e1b08b140defb89e2724dc8273c7e9801d69f366222ab98fd7e667009c
7
+ data.tar.gz: 81952d5af6365ac77374b5eb95afc28fe3af7eddfb005b8f8859a37390de413d59c284aedfa43e28d44a04f5bd1487c5761ea18e651686e8e964bb4aed8652f4
data/README.md CHANGED
@@ -5,7 +5,7 @@ This gem extends ActiveAdmin so that batch restore and batch archive actions wil
5
5
  This gem assumes that you have already configured [paranoia](https://github.com/radar/paranoia) for you desire resource. Add this line to your application's Gemfile:
6
6
 
7
7
  ```ruby
8
- gem "active_admin_paranoia" , '~> 1.0.9'
8
+ gem "active_admin_paranoia" , '~> 1.0.10'
9
9
 
10
10
  ```
11
11
 
@@ -18,6 +18,7 @@ en:
18
18
  other: "Successfully restored %{count} %{plural_model}"
19
19
  archived: "Archived"
20
20
  non_archived: "Non Archived"
21
+ restore_model: "Restore %{model}"
21
22
  restore: "Restore"
22
23
  restore_confirmation: "Are you sure you want to restore this?"
23
24
  something_wrong: "Something went wrong. Please try again"
@@ -17,6 +17,10 @@ module ActiveAdminParanoia
17
17
  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)
18
18
  end
19
19
 
20
+ action_item :restore, only: :show do
21
+ link_to(I18n.t('active_admin_paranoia.restore_model', model: resource_class.to_s.titleize), "#{resource_path(resource)}/restore", method: :put, data: { confirm: I18n.t('active_admin_paranoia.restore_confirmation') }) if authorized?(ActiveAdminParanoia::Auth::RESTORE, resource)
22
+ end
23
+
20
24
  member_action :restore, method: :put, confirm: proc{ I18n.t('active_admin_paranoia.restore_confirmation') }, if: proc{ authorized?(ActiveAdminParanoia::Auth::RESTORE, resource_class) } do
21
25
  resource.restore(recursive: true)
22
26
  redirect_to :back, notice: I18n.t('active_admin_paranoia.batch_actions.succesfully_restored', count: 1, model: resource_class.to_s.camelize.constantize.model_name, plural_model: resource_class.to_s.downcase.pluralize)
@@ -36,7 +40,7 @@ module ActiveAdmin
36
40
 
37
41
  def defaults(resource, options = {})
38
42
  if resource.respond_to?(:deleted?) && resource.deleted?
39
- if controller.action_methods.include?('restore') && authorized?(ActiveAdminParanoia::Auth::RESTORE, resource_class)
43
+ if controller.action_methods.include?('restore') && authorized?(ActiveAdminParanoia::Auth::RESTORE, resource)
40
44
  # TODO: find a way to use the correct path helper
41
45
  item I18n.t('active_admin_paranoia.restore'), "#{resource_path(resource)}/restore", method: :put, class: "restore_link #{options[:css_class]}",
42
46
  data: {confirm: I18n.t('active_admin_paranoia.restore_confirmation')}
@@ -1,3 +1,3 @@
1
1
  module ActiveAdminParanoia
2
- VERSION = '1.0.9'
2
+ VERSION = '1.0.10'
3
3
  end
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_admin_paranoia
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.9
4
+ version: 1.0.10
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-12-04 00:00:00.000000000 Z
11
+ date: 2017-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '4.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '4.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: paranoia
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.0'
41
41
  description: This gem extends ActiveAdmin so that batch restore and batch archive
@@ -48,7 +48,7 @@ executables: []
48
48
  extensions: []
49
49
  extra_rdoc_files: []
50
50
  files:
51
- - .gitignore
51
+ - ".gitignore"
52
52
  - Gemfile
53
53
  - LICENSE
54
54
  - README.md
@@ -70,17 +70,17 @@ require_paths:
70
70
  - lib
71
71
  required_ruby_version: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ! '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  required_rubygems_version: !ruby/object:Gem::Requirement
77
77
  requirements:
78
- - - ! '>='
78
+ - - ">="
79
79
  - !ruby/object:Gem::Version
80
80
  version: '0'
81
81
  requirements: []
82
82
  rubyforge_project:
83
- rubygems_version: 2.4.3
83
+ rubygems_version: 2.2.5
84
84
  signing_key:
85
85
  specification_version: 4
86
86
  summary: Paranoia extension for ActiveAdmin