standardapi 1.0.17 → 1.0.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/standard_api/helpers.rb +1 -1
- data/lib/standard_api/test_case/create_tests.rb +0 -1
- data/lib/standard_api/views/application/_record.json.jbuilder +2 -2
- data/lib/standard_api/views/application/index.json.jbuilder +1 -1
- data/lib/standard_api/views/application/show.json.jbuilder +2 -1
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a335bf3f3a1df576a464d696cfb2c4e08db85ebd
|
4
|
+
data.tar.gz: b1c17381aa0c534ccaec58ffa3a9d86fe53d37f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d08cab6b53e58fff34afd58d359c51bc4ae72f7d020d5ee35f649fc0f7f7589185225771b5dabd4a0a2250c5ec1f7d630c2b116368a7c62155b00bd2e0b9a0f
|
7
|
+
data.tar.gz: 5193ba62c57aa0aa3e997a73875ebf66434a06228897b5e13adb682a32cfefc802b5d562286a6815f30b190fa3c03b163ae373777df66bb54e76c9329deea489
|
data/lib/standard_api/helpers.rb
CHANGED
@@ -2,7 +2,7 @@ module StandardAPI
|
|
2
2
|
module Helpers
|
3
3
|
|
4
4
|
def model_partial(record)
|
5
|
-
if lookup_context.exists?(record.model_name.element, controller_name)
|
5
|
+
if lookup_context.exists?(record.model_name.element, controller_name, true)
|
6
6
|
[record.model_name.plural, record.model_name.element].join('/')
|
7
7
|
else
|
8
8
|
'application/record'
|
@@ -91,7 +91,6 @@ module StandardAPI
|
|
91
91
|
|
92
92
|
view_attributes(m).each do |key, value|
|
93
93
|
message = "Model / Attribute: #{m.class.name}##{key}"
|
94
|
-
byebug if m_json[key.to_s] != normalize_to_json(m, key, value)
|
95
94
|
assert_equal m_json[key.to_s], normalize_to_json(m, key, value)
|
96
95
|
end
|
97
96
|
|
@@ -12,13 +12,13 @@ includes.each do |inc, subinc|
|
|
12
12
|
|
13
13
|
if collection
|
14
14
|
partial = model_partial(association.klass)
|
15
|
-
json.array! record.send(inc), partial: partial, as:
|
15
|
+
json.array! record.send(inc), partial: partial, as: partial.split('/').last, locals: { includes: subinc }
|
16
16
|
else
|
17
17
|
if record.send(inc).nil?
|
18
18
|
json.set! association.klass.model_name.element, nil
|
19
19
|
else
|
20
20
|
partial = model_partial(record.send(inc))
|
21
|
-
json.partial! partial,
|
21
|
+
json.partial! partial, partial.split('/').last => record.send(inc), includes: subinc
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
@@ -1 +1 @@
|
|
1
|
-
json.array! instance_variable_get("@#{model.model_name.plural}"), partial: model_partial(model), as:
|
1
|
+
json.array! instance_variable_get("@#{model.model_name.plural}"), partial: model_partial(model), as: model_partial(model).split('/').last, includes: includes
|
@@ -1 +1,2 @@
|
|
1
|
-
json.partial! model_partial(model),
|
1
|
+
json.partial! model_partial(model), model_partial(model).split('/').last.to_sym => instance_variable_get("@#{model.model_name.singular}"), includes: includes
|
2
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: standardapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Bracy
|
@@ -178,6 +178,20 @@ dependencies:
|
|
178
178
|
- - ">="
|
179
179
|
- !ruby/object:Gem::Version
|
180
180
|
version: '0'
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: byebug
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - ">="
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '0'
|
188
|
+
type: :development
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - ">="
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '0'
|
181
195
|
description: StandardAPI makes it easy to expose a query interface for your Rails
|
182
196
|
models
|
183
197
|
email:
|