goldiloader 2.1.1 → 2.1.2

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: 7d32eaea199d074ab8988ec521e8a4ee67a0bf55
4
- data.tar.gz: 57c03bce045cb49c4aa70e47486ef36c56da654f
3
+ metadata.gz: c7414c0de13b4e9b5c87d8106cedfdb2028a3640
4
+ data.tar.gz: 2a0650488a2ebdc94d665fa12b3dc7d88282c791
5
5
  SHA512:
6
- metadata.gz: deab2653b8827c4b58b284229e87fc8af127c56101551e0e6b20c709c258f5c6713d998906308a6dd16bd00aab228ecc5bb4b1a255773722d5ccf74568c30cf1
7
- data.tar.gz: 54cca5bde1209f5f413a6bdd4f98fd286626022ecb03c23ccbde6de6c9cf34b0fe684507d5d1def4d91e14614737c3783eb322097592b51d68f145f89d71624c
6
+ metadata.gz: 46d11df02dbae98f7915b06df38937ba93937671433403ff1f161def9568b92cb1a310eb55eed6c9edb073e5851660bb890d7c324cafca12c99585d269ebd0e9
7
+ data.tar.gz: '09179806ac8786f88f059d0c3cba83c4a85acd7f9fe1794dca06ac6672da948b854264263c709911425689493c2932d7f242504a2b0d0d5f9818d0487b58da17'
@@ -100,6 +100,7 @@ module Goldiloader
100
100
  association_info = Goldiloader::AssociationInfo.new(self)
101
101
  !association_info.limit? &&
102
102
  !association_info.offset? &&
103
+ (!association_info.has_one? || !association_info.order?) &&
103
104
  (!association_info.group? || ::Goldiloader::Compatibility.group_eager_loadable?) &&
104
105
  (!association_info.from? || ::Goldiloader::Compatibility.from_eager_loadable?) &&
105
106
  !association_info.instance_dependent? &&
@@ -9,6 +9,10 @@ module Goldiloader
9
9
 
10
10
  delegate :association_scope, :reflection, to: :@association
11
11
 
12
+ def has_one?
13
+ reflection.has_one?
14
+ end
15
+
12
16
  def offset?
13
17
  association_scope && association_scope.offset_value.present?
14
18
  end
@@ -33,6 +37,10 @@ module Goldiloader
33
37
  association_scope && association_scope.group_values.present?
34
38
  end
35
39
 
40
+ def order?
41
+ association_scope && association_scope.order_values.present?
42
+ end
43
+
36
44
  def instance_dependent?
37
45
  reflection.scope.present? && reflection.scope.arity > 0
38
46
  end
@@ -1,5 +1,5 @@
1
1
  # encoding: UTF-8
2
2
 
3
3
  module Goldiloader
4
- VERSION = '2.1.1'.freeze
4
+ VERSION = '2.1.2'.freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: goldiloader
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Turkel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-13 00:00:00.000000000 Z
11
+ date: 2018-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord