api-blocks 0.4.4 → 0.4.5

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: f1065347d5b5638755e1591e0f347764fad5ca4960bb844dece4a5e4d3ae672d
4
- data.tar.gz: 885a64ab4774959c3bec6d2bcd5a8e731f845466ed15bfb3cdbefc0b26c9b4c5
3
+ metadata.gz: c689f6d7256e7f215405e818291937d1ccb5c3df78d56624f419e542a3b02df5
4
+ data.tar.gz: cebe4dd1fa4e7442a9a9fc5508fb82a82f43ff730f712c53bbf86d7e95a324b2
5
5
  SHA512:
6
- metadata.gz: 223b2b77ee3a6583d8b383ed5e0cfa1d7250845489c7fd6c7bb6f92cc8e4d008dc6077740d233b17c89aae824c8d668c98ddfeba739eebe3ce84ad444756bde8
7
- data.tar.gz: e76ae3f24886f98cef0404cbd78c65c298733dacf4b738fcccc1e52b33b54992d9e62485dc4cbbd47c23645e845c768e6e74be8537ab3695e289e173bce2fb98
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
@@ -2,5 +2,5 @@
2
2
 
3
3
  module ApiBlocks
4
4
  # Current version of ApiBlocks
5
- VERSION = '0.4.4'
5
+ VERSION = '0.4.5'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api-blocks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul d'Hubert