schema_based_api 2.1.15 → 2.1.16

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: f096bb076a59df02a1c9a51b348a4265b4c4bcc085ee17297873b31cafdfe70a
4
- data.tar.gz: 27a50ee08425905661fd685c4c5fed9619f2e86ca78aa510a1d18b749694452c
3
+ metadata.gz: 671eb99ac386ee3d1592c495f9b7dccc20127d9c2acb9bb42ca68666e063f037
4
+ data.tar.gz: a2dd8e4bb9a3925ca6311ad0d4c830f0c33143a9ba61b5fe03d8936d94872c1f
5
5
  SHA512:
6
- metadata.gz: 9bfceb05a06565d3896d4cf3cdfdffe2b99c99e034f4879cf8a83d75c15f283211ee59e7e956ad60080f52aa51a0e45f5a35cd8ca021ff9ccc829dbf5b1a9df1
7
- data.tar.gz: 1ddf3166f10c7e884081ed873f926ad25ca60e5382690a5a391b13777223616189184c8bb97b11047e7e1e1ea01839e27860632dd0a0d51dceeed39f763ffb5f
6
+ metadata.gz: 3718763554cb07b81e96287e95e63e3528a921d2f1b0ca55e9499e21d10e58397fc0da84d7aa88d5bfbb9bfe14fc707457e2cd995bec9ccec71ff8ff377d622b
7
+ data.tar.gz: 6ad31a659e2076a71e2d526d2bc4b345066b8e0ba9399a736672a34bec1ee487e6220dc001d86af1a44e9f9819492da2c2d55180678f0139c5b92804f038bc71
@@ -17,10 +17,10 @@ module SchemaBasedApiRole
17
17
  # - include: include associated models, it's a list [] of hashes {} which also
18
18
  # accepts the [:only, :except, :methods, :include] keys.
19
19
  cattr_accessor :json_attrs
20
- @@json_attrs = {
20
+ @@json_attrs = SchemaBasedApi.smart_merge((json_attrs || {}), {
21
21
  except: [:lock_version],
22
22
  include: [:users]
23
- }
23
+ })
24
24
 
25
25
  ## CUSTOM ACTIONS
26
26
  # Here you can add custom actions to be called from the API
@@ -21,10 +21,10 @@ module SchemaBasedApiUser
21
21
  # - include: include associated models, it's a list [] of hashes {} which also
22
22
  # accepts the [:only, :except, :methods, :include] keys.
23
23
  cattr_accessor :json_attrs
24
- @@json_attrs = {
24
+ @@json_attrs = SchemaBasedApi.smart_merge((json_attrs || {}), {
25
25
  except: [:lock_version],
26
26
  include: [:roles]
27
- }
27
+ })
28
28
 
29
29
  ## CUSTOM ACTIONS
30
30
  # Here you can add custom actions to be called from the API
@@ -11,6 +11,14 @@ require "simple_command"
11
11
 
12
12
  require 'concerns/api_exception_management'
13
13
 
14
+ require 'deep_merge/rails_compat'
15
+
14
16
  module SchemaBasedApi
15
- # Your code goes here...
17
+ def self.smart_merge src, dest
18
+ src.deeper_merge! dest, {
19
+ extend_existing_arrays: true,
20
+ merge_hash_arrays: true
21
+ }
22
+ src
23
+ end
16
24
  end
@@ -1,3 +1,3 @@
1
1
  module SchemaBasedApi
2
- VERSION = '2.1.15'
2
+ VERSION = '2.1.16'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schema_based_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.15
4
+ version: 2.1.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni
@@ -142,6 +142,20 @@ dependencies:
142
142
  - - "~>"
143
143
  - !ruby/object:Gem::Version
144
144
  version: '1.14'
145
+ - !ruby/object:Gem::Dependency
146
+ name: deep_merge
147
+ requirement: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - "~>"
150
+ - !ruby/object:Gem::Version
151
+ version: '1.2'
152
+ type: :runtime
153
+ prerelease: false
154
+ version_requirements: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - "~>"
157
+ - !ruby/object:Gem::Version
158
+ version: '1.2'
145
159
  - !ruby/object:Gem::Dependency
146
160
  name: sqlite3
147
161
  requirement: !ruby/object:Gem::Requirement