standardapi 5.2.0.8 → 5.2.0.9

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: cc7347ed6a4d47843612e12b7278e2cf6f75f44b96b64ef5677ed04cee4e2974
4
- data.tar.gz: a9d2e82efbf35bc54d0b21dd94de196a931d72dc1f58c36c8578abff69433909
3
+ metadata.gz: fc23801e0efd324a12cd008b60189eeb928f83bf61521a1007c0f4e557a62a33
4
+ data.tar.gz: 77c05742aa31ac7db81eb54f451fb575ce3a1e62873c99a5f6ffc80dac016821
5
5
  SHA512:
6
- metadata.gz: 41c4ba5e6bcc543fa8a823a6c4422b6773735a57fe1d5be418f712617b1d695c0cd4e437afeedd33dd686cdbed295f3e10fb0d27da165600d99576a8c7e49de2
7
- data.tar.gz: 349e1314c7bc7f3a3955eb88bc906749e2217ba9edd3903ea210f82f02ff9ce78afd2ee521f43381bb68b81b3d4ba1034b3ec3b35fc40c40d51e1625fbcd6204
6
+ metadata.gz: b46fc52c901f782067480f96142b55819227be4df904d8467fe977e7eb78e95bf94e2959669713a0b3f488e9cab75b1a4c981ad81652a78105921b9a9505c85c
7
+ data.tar.gz: 208e6f0c9c4fdef2fc5f9afcf673ece3707265fe4a74a175b9e599d47b9e4a9ab88772f3e1bdabf27aee80dd3cc4a5c261285c8d6c741f7dae7058e26458494a
@@ -1,3 +1,3 @@
1
1
  module StandardAPI
2
- VERSION = '5.2.0.8'
2
+ VERSION = '5.2.0.9'
3
3
  end
@@ -1,5 +1,16 @@
1
1
  if !includes.empty?
2
- instance_variable_set("@#{model.model_name.plural}", instance_variable_get("@#{model.model_name.plural}").preload(includes.keys))
2
+ preloads = includes.keys.select do |key|
3
+ case includes[key]
4
+ when true
5
+ true
6
+ when Hash
7
+ !(includes[key].keys.any? { |x| ['where', 'limit', 'offset', 'order'].include?(x) })
8
+ else
9
+ false
10
+ end
11
+ end
12
+
13
+ instance_variable_set("@#{model.model_name.plural}", instance_variable_get("@#{model.model_name.plural}").preload(preloads))
3
14
  end
4
15
 
5
16
  if !includes.empty? && can_cache?(model, includes)
@@ -1,5 +1,16 @@
1
1
  if !includes.empty?
2
- instance_variable_set("@#{model.model_name.plural}", instance_variable_get("@#{model.model_name.plural}").preload(includes.keys))
2
+ preloads = includes.keys.select do |key|
3
+ case includes[key]
4
+ when true
5
+ true
6
+ when Hash
7
+ !(includes[key].keys.any? { |x| ['where', 'limit', 'offset', 'order'].include?(x) })
8
+ else
9
+ false
10
+ end
11
+ end
12
+
13
+ instance_variable_set("@#{model.model_name.plural}", instance_variable_get("@#{model.model_name.plural}").preload(preloads))
3
14
  end
4
15
 
5
16
  if !includes.empty? && can_cache?(model, includes)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: standardapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.0.8
4
+ version: 5.2.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Bracy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-28 00:00:00.000000000 Z
11
+ date: 2019-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails