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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 78f2be0ff070f22c4a9a630af130d7619a3a5082f58b66183dd9a16569461375
|
4
|
+
data.tar.gz: 6d4950083667682aea84fd16a4586a546a6730b7784e5fc715ece4d7c6129aac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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?(:
|
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
|
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
|
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.
|
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:
|
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
|
-
|
67
|
-
|
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: []
|