effective_resources 2.8.5 → 2.8.7
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b20557b39c6a58e12d87157ccc21b3ce99ac38e2a57e1c3c45b0a07333d45e05
|
4
|
+
data.tar.gz: 2bfc034398f369c999e26f8907c6790d127102d9416b5914e63066b16003d452
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2e218f0580ab6d3a5f7a2f7bfaf5d2d27967f1670628dbb8580d6e4d44717c80904ac4bbb33c15f1da079420e5a3518cfb0a1dc8ce00bd5c58d49396941bf43
|
7
|
+
data.tar.gz: d2e2f6fd1cd3ca5a6de6b6c6e3ed306d10a1615b1b9abdc534d4510fa91612a79eb947ff08cc4746b57162ebc1e5d586adf4dc385a8f773b63878b6d59442235
|
@@ -19,9 +19,16 @@ module Effective
|
|
19
19
|
|
20
20
|
self.resource ||= resource_scope.new
|
21
21
|
|
22
|
+
# Assign attributes from the query string
|
22
23
|
to_assign = if view_context.respond_to?(:inline_datatable?) && view_context.inline_datatable?
|
23
24
|
EffectiveDatatables.find(params[:_datatable_id], params[:_datatable_attributes]).attributes
|
24
|
-
|
25
|
+
end
|
26
|
+
|
27
|
+
to_assign ||= if params[resource_name].present? && params[resource_name].respond_to?(:to_unsafe_h)
|
28
|
+
params[resource_name].to_unsafe_h
|
29
|
+
end
|
30
|
+
|
31
|
+
to_assign ||= if params.present?
|
25
32
|
params.to_unsafe_h.except(:controller, :action, :id, :duplicate_id)
|
26
33
|
end
|
27
34
|
|
@@ -31,10 +38,7 @@ module Effective
|
|
31
38
|
|
32
39
|
# Duplicate if possible
|
33
40
|
if params[:duplicate_id].present?
|
34
|
-
duplicate =
|
35
|
-
duplicate ||= (resource_scope.find_by_id(params[:duplicate_id]) rescue nil)
|
36
|
-
|
37
|
-
raise ActiveRecord::RecordNotFound unless duplicate.present?
|
41
|
+
duplicate = resource_scope.find(params[:duplicate_id])
|
38
42
|
|
39
43
|
EffectiveResources.authorize!(self, :show, duplicate)
|
40
44
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_resources
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.8.
|
4
|
+
version: 2.8.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|