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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 671eb99ac386ee3d1592c495f9b7dccc20127d9c2acb9bb42ca68666e063f037
|
4
|
+
data.tar.gz: a2dd8e4bb9a3925ca6311ad0d4c830f0c33143a9ba61b5fe03d8936d94872c1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/schema_based_api.rb
CHANGED
@@ -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
|
-
|
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
|
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.
|
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
|