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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cfb1c23d2453ac01d0d60adf072758dc037c2a38
4
- data.tar.gz: 8ee95f0a6eff6f7d28f740fb3de1a79e03e9cfe4
3
+ metadata.gz: f5ad36fe87b1931ab4b094ef8ccfaedc0451589e
4
+ data.tar.gz: 6002ec9b7d4f188f467eb7f083b00f9ea538fdb5
5
5
  SHA512:
6
- metadata.gz: a650fd5858cc696e7377021a0e2672bae082d832f2844fef0aa822cbcf50ea521cd2cbb27bdf13d48500e0147225b36b60bbbc3868a53ee7a607b07f686a95e5
7
- data.tar.gz: 29763f607715391ec02a1a299e5d85ba4a981529b2c5fe759995e174716412e67f47c818085c4a5a55c08849bcd1dc7072fe15dc89b0289b1140e8c2159cc7f8
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
- query = query.includes(*model_class.fields_to_includes(fields)) if optimize_query
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)
@@ -1,5 +1,5 @@
1
1
  module Fields
2
2
  module Serializer
3
- VERSION = "0.8.4"
3
+ VERSION = "0.8.5"
4
4
  end
5
5
  end
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
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-03-26 00:00:00.000000000 Z
13
+ date: 2018-04-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler