api-blocks 0.4.4 → 0.4.5
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/api_blocks/controller.rb +9 -0
- data/lib/api_blocks/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c689f6d7256e7f215405e818291937d1ccb5c3df78d56624f419e542a3b02df5
|
|
4
|
+
data.tar.gz: cebe4dd1fa4e7442a9a9fc5508fb82a82f43ff730f712c53bbf86d7e95a324b2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 405102e9d529bef8a79e30f1c3a86ea81d7301941cb62feabf9a99b27a33b225dca805f0c0a989ce742aef4fadf026783ab2cadb73c459b335884182b3183905
|
|
7
|
+
data.tar.gz: 80989b093a59a84217e200d99eac74009ab450b1365762fc4ef9e2957748dce89b8c4e5df5196227ef1378b87ef547811c1fd4b341fed40de61b195bd01b5dd3
|
|
@@ -57,6 +57,15 @@ module ApiBlocks::Controller
|
|
|
57
57
|
end
|
|
58
58
|
|
|
59
59
|
class_methods do
|
|
60
|
+
# Returns the `pundit_api_scope` value that was defined last looking up into
|
|
61
|
+
# the inheritance chain of the current class.
|
|
62
|
+
def inherited_pundit_api_scope
|
|
63
|
+
ancestors
|
|
64
|
+
.select { |a| a.respond_to?(:pundit_api_scope) }
|
|
65
|
+
.find(&:pundit_api_scope)
|
|
66
|
+
.pundit_api_scope
|
|
67
|
+
end
|
|
68
|
+
|
|
60
69
|
# Provide a default scope to pundit's `PolicyFinder`.
|
|
61
70
|
def pundit_scope(*scope)
|
|
62
71
|
self.pundit_api_scope = scope
|
data/lib/api_blocks/version.rb
CHANGED