active_scaffold_duplicate 1.1.3 → 1.1.4

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
  SHA256:
3
- metadata.gz: 47c6903bcee8b8ceb19663f449ee1145d5dc7f983164a9a48b44dc5677ed4d73
4
- data.tar.gz: 28d7372890e6a0ce5f0002f454307063a49e4913f803fc766293fbb02189569e
3
+ metadata.gz: 78f2be0ff070f22c4a9a630af130d7619a3a5082f58b66183dd9a16569461375
4
+ data.tar.gz: 6d4950083667682aea84fd16a4586a546a6730b7784e5fc715ece4d7c6129aac
5
5
  SHA512:
6
- metadata.gz: 81a79847ad92fc3367aa63dfda76e0e78ae71080d0f9f7713b24263ec072c8dbb9894479b82fe1da2b404b906de4b230a9c86f0628772d450230ece869939dc5
7
- data.tar.gz: 86a94b7a382803f0e83c2e4e14d2d90bdae5cc472ad5363b615aae76395382fa1c505533013b00824d8e0ee7e22d012e46ee6b34ec1342ec4d276fef18b5a647
6
+ metadata.gz: 7813adc9c072eca9f11b3e5caefabb8ad0d42b7e7a4428325b28f30529c33ad0621da7f91d574321a1f8f3de2dcb7afb9cff4fd9cf85cd3e9a0c63c8f0164e8d
7
+ data.tar.gz: 34e53f4f665ed36066bae9a1108a3c61a91a6600b5b3ff6daadf12ff50daa0d55a6be28a7633ca51f6ee6f9f4606bb7361975009a05dcab70e7e995310e5146f
@@ -5,7 +5,7 @@ module ActiveScaffold::Actions
5
5
  end
6
6
 
7
7
  def duplicate
8
- @old_record = find_if_allowed(params[:id], :read)
8
+ @old_record = find_if_allowed(params[:id], crud_type: :read, action: :duplicate)
9
9
  @record = @old_record.send(active_scaffold_config.duplicate.method)
10
10
  if request.post?
11
11
  before_duplicate_save(@record)
@@ -25,7 +25,7 @@ module ActiveScaffold::Actions
25
25
  def after_duplicate_save(record); end
26
26
 
27
27
  def duplicate_authorized?(record = nil)
28
- (record || self).authorized_for?(:crud_type => :create, :action => :duplicate)
28
+ (record || self).authorized_for?(crud_type: :create, action: :duplicate, reason: true)
29
29
  end
30
30
 
31
31
  def duplicate_respond_to_html
@@ -61,7 +61,7 @@ module ActiveScaffold::Actions
61
61
  private
62
62
  def duplicate_authorized_filter
63
63
  link = active_scaffold_config.duplicate.link || active_scaffold_config.duplicate.class.link
64
- raise ActiveScaffold::ActionNotAllowed unless self.send(link.security_method)
64
+ raise ActiveScaffold::ActionNotAllowed unless Array(send(link.security_method))[0]
65
65
  end
66
66
  def duplicate_formats
67
67
  (default_formats + active_scaffold_config.formats + active_scaffold_config.duplicate.formats).uniq
@@ -2,7 +2,7 @@ module ActiveScaffoldDuplicate
2
2
  module Version
3
3
  MAJOR = 1
4
4
  MINOR = 1
5
- PATCH = 3
5
+ PATCH = 4
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_scaffold_duplicate
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergio Cambra
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-13 00:00:00.000000000 Z
11
+ date: 2022-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_scaffold
@@ -48,7 +48,7 @@ homepage: http://github.com/activescaffold/active_scaffold_duplicate
48
48
  licenses:
49
49
  - MIT
50
50
  metadata: {}
51
- post_install_message:
51
+ post_install_message:
52
52
  rdoc_options: []
53
53
  require_paths:
54
54
  - lib
@@ -63,9 +63,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
63
63
  - !ruby/object:Gem::Version
64
64
  version: '0'
65
65
  requirements: []
66
- rubyforge_project:
67
- rubygems_version: 2.7.9
68
- signing_key:
66
+ rubygems_version: 3.0.9
67
+ signing_key:
69
68
  specification_version: 4
70
69
  summary: Clone record gem for Activescaffold
71
70
  test_files: []