fields-serializer 0.8.4 → 0.8.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fields/serializer/action_controller.rb +4 -1
- data/lib/fields/serializer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5ad36fe87b1931ab4b094ef8ccfaedc0451589e
|
4
|
+
data.tar.gz: 6002ec9b7d4f188f467eb7f083b00f9ea538fdb5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ea2ae96a6ae5549847b715f9a1a2eafd6c9b3eb8eb523d7ae422d82f73fff31d189e708517b504f764749cad1e02e0e153d15c3c52c0454e8090bb11bf9aff3
|
7
|
+
data.tar.gz: 50ac78b67b3a791fe03bfbda3c633b979dd91b99dacb011ba390b01c1a8cb895514fcebc42e47a2601d02978338e16970964025e7731d636964075058cfbd4fd
|
@@ -16,7 +16,10 @@ module Fields
|
|
16
16
|
fields = options.delete(:fields)
|
17
17
|
model_class = options.delete(:model_class)
|
18
18
|
if fields.present?
|
19
|
-
|
19
|
+
if optimize_query
|
20
|
+
includes = model_class.fields_to_includes(fields)
|
21
|
+
query = query.includes(*includes) if includes
|
22
|
+
end
|
20
23
|
options.merge!(each_serializer: model_class.fields_serializer(fields), include: "**")
|
21
24
|
end
|
22
25
|
render options.merge!(json: query.to_a)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fields-serializer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stuart Chinery
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2018-
|
13
|
+
date: 2018-04-13 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|