snfoil 0.8.3 → 0.8.4
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 +4 -4
- data/lib/sn_foil/contexts/build_context.rb +2 -1
- data/lib/sn_foil/contexts/destroy_context.rb +2 -1
- data/lib/sn_foil/contexts/setup_context.rb +3 -2
- data/lib/sn_foil/contexts/show_context.rb +2 -1
- data/lib/sn_foil/contexts/update_context.rb +2 -1
- data/lib/sn_foil/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '045808cc9c5390abbc6b359c23b7938af8b786a3f13671b20c7212dddd40fa0c'
|
4
|
+
data.tar.gz: 72ce3d125a2200a4345bda493ed98037f94d7eaf9d61e928555b4ef659eb7acc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad8743cd6fa8a9492b8a639d9b28554ea8738d754a26146a8cd0044b8dab8447280b45f53aa805e2a92df9bae0026e2ee55ae69efdb919126aad8af390b867f2
|
7
|
+
data.tar.gz: e92a4cb99c600270f10d37bb4993c7c274e087ccd3fe096699d859639de5c9f0b1def2fe67cf71bb797a460229bc4484ed343cb46edbd4e9d531f224ced04fe3
|
@@ -56,7 +56,8 @@ module SnFoil
|
|
56
56
|
def setup_destroy_object(id: nil, object: nil, **options)
|
57
57
|
raise ArgumentError, 'one of the following keywords is required: id, object' unless id || object
|
58
58
|
|
59
|
-
options
|
59
|
+
options[:object] = wrap_object(object || scope.resolve.find(id))
|
60
|
+
options
|
60
61
|
end
|
61
62
|
|
62
63
|
def destroy(**options)
|
@@ -104,10 +104,11 @@ module SnFoil
|
|
104
104
|
|
105
105
|
def lookup_policy(object, options)
|
106
106
|
lookup = if options[:policy]
|
107
|
-
options[:policy].new(entity, object)
|
107
|
+
options[:policy].new(entity, object, options: options)
|
108
108
|
elsif policy
|
109
|
-
policy.new(entity, object)
|
109
|
+
policy.new(entity, object, options: options)
|
110
110
|
else
|
111
|
+
SnFoil.logger.debug 'No policy found. Looking up policy using Pundit. `options` will not be passed to policy'
|
111
112
|
Pundit.policy!(entity, object)
|
112
113
|
end
|
113
114
|
|
@@ -29,7 +29,8 @@ module SnFoil
|
|
29
29
|
def setup_show_object(id: nil, object: nil, **options)
|
30
30
|
raise ArgumentError, 'one of the following keywords is required: id, object' unless id || object
|
31
31
|
|
32
|
-
options
|
32
|
+
options[:object] = wrap_object(object || scope.resolve.find(id))
|
33
|
+
options
|
33
34
|
end
|
34
35
|
|
35
36
|
def setup_show_hooks
|
data/lib/sn_foil/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snfoil
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Howes
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-
|
13
|
+
date: 2021-09-17 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|