cancancan_nested_auth 0.1.0 → 1.0.0

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: 3dc3968e597bcafec1512406e02e86a03bc3c76812c8680280cb2eda8b36e2a4
4
- data.tar.gz: f07be991d4caedc6c7a9fd83de61d811810751a2019a468f01b9ed34b93cd831
3
+ metadata.gz: dfb4fbb1dfb77fefb8093c8b34cb03cc7014981a3b15a8c83e8574a9c3aeeb3a
4
+ data.tar.gz: ad181c3e808686f022518523a0857804ec9127868a61013051dd14b623b44dee
5
5
  SHA512:
6
- metadata.gz: a19784886f5e180f91e4026ce959304e24179bc1fa05579ac1fb2e841e020c8bad770e11ba4982d29012795b19f5738fd5755910787f098d1d676deb224124a8
7
- data.tar.gz: a2c74ae68e057949956af981bacf6296c23c3e2d69e07d08c21e0b394b325a9aa704a0ac045c2e0b5685abc06dc64430ed465fa61f3824309b540f3a37e18d7c
6
+ metadata.gz: 2144f3da1801f95bcc25b9b23a933cb5ba542abcb89049557d99c8b7c66fbed9c1add45ce2b4009657cb22b1792d56cd5c57ddbba69cb3528610c560b8b7e43b
7
+ data.tar.gz: 3803d9b0298714e3f086e2f1d5481f793f1e8e13a08d5a0e3a0311091f70ab45c38b3ec0adc82edcff16570999c00337462ae33cd0ab9e9b0d07e6c92ace9962
@@ -13,7 +13,7 @@ module CanCanCan
13
13
  # - i.e. params => {user: {email: 'test', name: 'fun'}}
14
14
  # Set to `false` if resource parameter data is direct in in params.
15
15
  # - i.e. params => {email: 'test', name: 'fun'}
16
- @use_resource_key_in_params = false
16
+ @use_resource_key_in_params = true
17
17
  end
18
18
  end
19
19
  end
@@ -16,6 +16,9 @@ module CanCanCan
16
16
  @ability = current_ability
17
17
  @parent_object = parent_object
18
18
  @params = params
19
+ if CanCanCan::NestedAssignmentAndAuthorization.configuration.use_resource_key_in_params
20
+ @params = @params[parent_object.model_name.singular.to_sym]
21
+ end
19
22
  if @params.kind_of?(ActionController::Parameters)
20
23
  @params = @params.permit!.to_h
21
24
  end
@@ -1,5 +1,5 @@
1
1
  module CanCanCan
2
2
  module NestedAssignmentAndAuthorization
3
- VERSION = '0.1.0'
3
+ VERSION = '1.0.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cancancan_nested_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - benjamin.dana.software.dev@gmail.com