bullet_train-super_load_and_authorize_resource 1.2.10 → 1.2.11

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: 85bbd6c03d039f10d676167ac2cc2cfa7e576b39a3ef892b89cc6d7d086ba23d
4
- data.tar.gz: 913268a6c376b32399c8ab1567984db7042785495e51e66be73bc0a060009ae0
3
+ metadata.gz: '009a6c9c68e70790436b5f8ee20644992cfbe3c3d23b9fe65d46f4bcd78d2635'
4
+ data.tar.gz: 80dc57606c409a284d6042aec16b6926661cadd298c5f72a1e7d31d6ad6da80c
5
5
  SHA512:
6
- metadata.gz: c16871e4a815174d91dd7b4aceae608ab38a7fde881b650cb780b9204ceb18d57786c1234fe5e2188564a2cefd705949c9d07fef347b9bbf4be60e92d42b5dd2
7
- data.tar.gz: 0f823117e2c303b271ecd26f72720534ebc28d345aefe6c53170d9222fce900687c67ae1e9ab7d2952e03a251aac69145aa69621583025924a8d4b6d86b61440
6
+ metadata.gz: 4da6e397a39c2c29fffa212b0706ff5c48f0b932a942bdcdad45f6c2fa2d68ad723df51b0671e08a896001e1c8301eac751c5223a7a77c3483e517f07b79558e
7
+ data.tar.gz: 6b1b04b69d3791b55e277f53ebd4c9215e1be4b334e0ad9314ceb79fef66bbcde914c27a74c7bdde1c6cdfa056972c2086dd6321200a5130e61111ea4af4b04e
@@ -7,8 +7,14 @@ module LoadsAndAuthorizesResource
7
7
  end
8
8
 
9
9
  def load_team
10
- # Sometimes `@team` has already been populated by earlier `before_action` steps.
11
- @team ||= @child_object&.team || @parent_object&.team
10
+ # Not all objects that need to be authorized belong to a team,
11
+ # so we give @team a nil value if no association is found.
12
+ begin
13
+ # Sometimes `@team` has already been populated by earlier `before_action` steps.
14
+ @team ||= @child_object&.team || @parent_object&.team
15
+ rescue NoMethodError
16
+ @team = nil
17
+ end
12
18
 
13
19
  # Update current attributes.
14
20
  Current.team = @team
@@ -1,5 +1,5 @@
1
1
  module BulletTrain
2
2
  module SuperLoadAndAuthorizeResource
3
- VERSION = "1.2.10"
3
+ VERSION = "1.2.11"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train-super_load_and_authorize_resource
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.10
4
+ version: 1.2.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-31 00:00:00.000000000 Z
11
+ date: 2023-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails