json_apiable 0.4 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +21 -21
- data/json_apiable.gemspec +1 -1
- data/lib/json_apiable/json_apiable.rb +12 -6
- data/lib/json_apiable/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7f8ca1f3bf0021a5b326f69c09fa891813c63da56824acafb67f5edf22b8cc6
|
4
|
+
data.tar.gz: 13c3c4b1e542b688241eaf73be98e35d35c0d712ce552d77243cf958fdce3d34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 941b661ae943c9e6b5344be482740356f78ee75393ed334ddf97516ba5f08bc821252ae34fa3d33d2142366b779095aebe7f8e8600280ffa9ce22acb3eded9a1
|
7
|
+
data.tar.gz: 66f37012eb785a178d5dd2c14979f3296f3818c8b86f940c33b1d6269fa8b5350a1dab1de9993e61c366f98251542870afe66f5ed42bcd56569951ecd3c3395c
|
data/Gemfile.lock
CHANGED
@@ -65,10 +65,10 @@ GEM
|
|
65
65
|
tzinfo (~> 1.1)
|
66
66
|
zeitwerk (~> 2.2)
|
67
67
|
builder (3.2.4)
|
68
|
-
byebug (11.
|
68
|
+
byebug (11.1.1)
|
69
69
|
coderay (1.1.2)
|
70
|
-
concurrent-ruby (1.1.
|
71
|
-
crass (1.0.
|
70
|
+
concurrent-ruby (1.1.6)
|
71
|
+
crass (1.0.6)
|
72
72
|
diff-lcs (1.3)
|
73
73
|
erubi (1.9.0)
|
74
74
|
factory_bot (5.1.1)
|
@@ -76,15 +76,15 @@ GEM
|
|
76
76
|
factory_bot_rails (5.1.1)
|
77
77
|
factory_bot (~> 5.1.0)
|
78
78
|
railties (>= 4.2.0)
|
79
|
-
faker (2.
|
80
|
-
i18n (>= 1.6, <
|
79
|
+
faker (2.10.2)
|
80
|
+
i18n (>= 1.6, < 2)
|
81
81
|
fast_jsonapi (1.5)
|
82
82
|
activesupport (>= 4.2)
|
83
83
|
globalid (0.4.2)
|
84
84
|
activesupport (>= 4.2.0)
|
85
|
-
i18n (1.
|
85
|
+
i18n (1.8.3)
|
86
86
|
concurrent-ruby (~> 1.0)
|
87
|
-
loofah (2.
|
87
|
+
loofah (2.6.0)
|
88
88
|
crass (~> 1.0.2)
|
89
89
|
nokogiri (>= 1.5.9)
|
90
90
|
mail (2.7.1)
|
@@ -92,20 +92,20 @@ GEM
|
|
92
92
|
marcel (0.3.3)
|
93
93
|
mimemagic (~> 0.3.2)
|
94
94
|
method_source (0.9.2)
|
95
|
-
mimemagic (0.3.
|
95
|
+
mimemagic (0.3.5)
|
96
96
|
mini_mime (1.0.2)
|
97
97
|
mini_portile2 (2.4.0)
|
98
|
-
minitest (5.
|
98
|
+
minitest (5.14.1)
|
99
99
|
nio4r (2.5.2)
|
100
|
-
nokogiri (1.10.
|
100
|
+
nokogiri (1.10.9)
|
101
101
|
mini_portile2 (~> 2.4.0)
|
102
102
|
pry (0.12.2)
|
103
103
|
coderay (~> 1.1.0)
|
104
104
|
method_source (~> 0.9.0)
|
105
|
-
pry-byebug (3.
|
105
|
+
pry-byebug (3.8.0)
|
106
106
|
byebug (~> 11.0)
|
107
107
|
pry (~> 0.10)
|
108
|
-
rack (2.
|
108
|
+
rack (2.2.3)
|
109
109
|
rack-test (1.1.0)
|
110
110
|
rack (>= 1.0, < 3)
|
111
111
|
rails (6.0.2.1)
|
@@ -138,13 +138,13 @@ GEM
|
|
138
138
|
method_source
|
139
139
|
rake (>= 0.8.7)
|
140
140
|
thor (>= 0.20.3, < 2.0)
|
141
|
-
rake (
|
142
|
-
rspec-core (3.9.
|
143
|
-
rspec-support (~> 3.9.
|
141
|
+
rake (13.0.1)
|
142
|
+
rspec-core (3.9.1)
|
143
|
+
rspec-support (~> 3.9.1)
|
144
144
|
rspec-expectations (3.9.0)
|
145
145
|
diff-lcs (>= 1.2.0, < 2.0)
|
146
146
|
rspec-support (~> 3.9.0)
|
147
|
-
rspec-mocks (3.9.
|
147
|
+
rspec-mocks (3.9.1)
|
148
148
|
diff-lcs (>= 1.2.0, < 2.0)
|
149
149
|
rspec-support (~> 3.9.0)
|
150
150
|
rspec-rails (3.9.0)
|
@@ -155,7 +155,7 @@ GEM
|
|
155
155
|
rspec-expectations (~> 3.9.0)
|
156
156
|
rspec-mocks (~> 3.9.0)
|
157
157
|
rspec-support (~> 3.9.0)
|
158
|
-
rspec-support (3.9.
|
158
|
+
rspec-support (3.9.2)
|
159
159
|
sprockets (4.0.0)
|
160
160
|
concurrent-ruby (~> 1.0)
|
161
161
|
rack (> 1, < 3)
|
@@ -166,12 +166,12 @@ GEM
|
|
166
166
|
sqlite3 (1.4.2)
|
167
167
|
thor (1.0.1)
|
168
168
|
thread_safe (0.3.6)
|
169
|
-
tzinfo (1.2.
|
169
|
+
tzinfo (1.2.7)
|
170
170
|
thread_safe (~> 0.1)
|
171
171
|
websocket-driver (0.7.1)
|
172
172
|
websocket-extensions (>= 0.1.0)
|
173
|
-
websocket-extensions (0.1.
|
174
|
-
zeitwerk (2.
|
173
|
+
websocket-extensions (0.1.5)
|
174
|
+
zeitwerk (2.3.0)
|
175
175
|
|
176
176
|
PLATFORMS
|
177
177
|
ruby
|
@@ -185,7 +185,7 @@ DEPENDENCIES
|
|
185
185
|
pry-byebug
|
186
186
|
rails
|
187
187
|
rails-controller-testing
|
188
|
-
rake (~>
|
188
|
+
rake (~> 13.0)
|
189
189
|
rspec-rails (~> 3.9)
|
190
190
|
sqlite3
|
191
191
|
|
data/json_apiable.gemspec
CHANGED
@@ -35,7 +35,7 @@ Gem::Specification.new do |spec|
|
|
35
35
|
spec.add_development_dependency 'pry-byebug'
|
36
36
|
spec.add_development_dependency 'rails'
|
37
37
|
spec.add_development_dependency 'rails-controller-testing'
|
38
|
-
spec.add_development_dependency 'rake', '~>
|
38
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
39
39
|
spec.add_development_dependency 'rspec-rails', '~> 3.9'
|
40
40
|
spec.add_development_dependency 'sqlite3'
|
41
41
|
end
|
@@ -72,23 +72,29 @@ module JsonApiable
|
|
72
72
|
end
|
73
73
|
|
74
74
|
def jsonapi_assign_params
|
75
|
-
@jsonapi_assign_params
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
75
|
+
return @jsonapi_assign_params if @jsonapi_assign_params.present? && !@invalidate_assign_params
|
76
|
+
|
77
|
+
@jsonapi_assign_params = ParamsParser.parse_body_params(request,
|
78
|
+
jsonapi_build_params,
|
79
|
+
jsonapi_allowed_attributes,
|
80
|
+
jsonapi_exclude_attributes,
|
81
|
+
jsonapi_allowed_relationships,
|
82
|
+
jsonapi_exclude_relationships)
|
83
|
+
@invalidate_assign_params = false
|
84
|
+
@jsonapi_assign_params
|
81
85
|
end
|
82
86
|
|
83
87
|
def jsonapi_exclude_attribute(attrib_key)
|
84
88
|
@jsonapi_exclude_attributes ||= []
|
85
89
|
@jsonapi_exclude_attributes << attrib_key.to_sym
|
90
|
+
@invalidate_assign_params = true
|
86
91
|
jsonapi_build_params.dig(:data, :attributes, attrib_key)
|
87
92
|
end
|
88
93
|
|
89
94
|
def jsonapi_exclude_relationship(rel_key)
|
90
95
|
@jsonapi_exclude_relationships ||= []
|
91
96
|
@jsonapi_exclude_relationships << rel_key.to_sym
|
97
|
+
@invalidate_assign_params = true
|
92
98
|
jsonapi_build_params.dig(:data, :relationships, rel_key)
|
93
99
|
end
|
94
100
|
|
data/lib/json_apiable/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json_apiable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Polischuk
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -156,14 +156,14 @@ dependencies:
|
|
156
156
|
requirements:
|
157
157
|
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: '
|
159
|
+
version: '13.0'
|
160
160
|
type: :development
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
164
|
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: '
|
166
|
+
version: '13.0'
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: rspec-rails
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|