goldiloader 3.0.0 → 3.0.1

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: de665e9942d28b42bbc8358aef8a0988a6790916
4
- data.tar.gz: ce84f8c27963cd4232cee01952143e5d2d6555e5
3
+ metadata.gz: ddfe79d8e20eeabfb358028da2573e4841c54e28
4
+ data.tar.gz: 3c3ef465fe8ac265cde235af7a0f6ea7694c78f2
5
5
  SHA512:
6
- metadata.gz: bc34b71e88333002565cfb97c2841318782e5e38a3255338f9a70a871d7828f1f8ea2308a7400280949d8893a083ed4fc12a86cf2af921ca35e093aba34c40eb
7
- data.tar.gz: 89187ce69caf6a448c1bb887a7e33c7b9bee434376d53f62376069923572f3bac86f12b3a21238ff8411b0a4ea7292f4c1abb1de479700950c58d6a758d46bcc
6
+ metadata.gz: dd2e360d5ffcd1b5e65d99fb64b39e89c634e4215573b31686fced83396630986ce3b70eb68ddd9d44a625a881f627a825b604a676b1d360ec49dd0818a40df9
7
+ data.tar.gz: 75f0d7513c06102e23087c2f9964e16732bf83953e4437d4bb0885b303f25be1baece29e6830f575ee4442996c66c4ddee1bd70a0b752bb79867f7926461e09e
@@ -98,14 +98,14 @@ module Goldiloader
98
98
 
99
99
  def eager_loadable?
100
100
  association_info = Goldiloader::AssociationInfo.new(self)
101
- !association_info.limit? &&
101
+ association_info.auto_include? &&
102
+ !association_info.limit? &&
102
103
  !association_info.offset? &&
103
104
  (!association_info.has_one? || !association_info.order?) &&
104
- (!association_info.group? || ::Goldiloader::Compatibility.group_eager_loadable?) &&
105
- (!association_info.from? || ::Goldiloader::Compatibility.from_eager_loadable?) &&
106
- !association_info.instance_dependent? &&
107
- association_info.auto_include? &&
108
- (!owner.destroyed? || ::Goldiloader::Compatibility.destroyed_model_associations_eager_loadable?)
105
+ (::Goldiloader::Compatibility.group_eager_loadable? || !association_info.group?) &&
106
+ (::Goldiloader::Compatibility.from_eager_loadable? || !association_info.from?) &&
107
+ (::Goldiloader::Compatibility.destroyed_model_associations_eager_loadable? || !owner.destroyed?) &&
108
+ !association_info.instance_dependent?
109
109
  end
110
110
 
111
111
  def load_with_auto_include
@@ -3,6 +3,7 @@
3
3
  module Goldiloader
4
4
  module Compatibility
5
5
  ACTIVE_RECORD_VERSION = ::Gem::Version.new(::ActiveRecord::VERSION::STRING)
6
+ RAILS_5_2_0 = ACTIVE_RECORD_VERSION == ::Gem::Version.new('5.2.0')
6
7
  PRE_RAILS_5_2 = ACTIVE_RECORD_VERSION < ::Gem::Version.new('5.2.0')
7
8
  POST_RAILS_5_1_4 = ACTIVE_RECORD_VERSION > ::Gem::Version.new('5.1.5')
8
9
  PRE_RAILS_5_1_5 = ACTIVE_RECORD_VERSION < ::Gem::Version.new('5.1.5')
@@ -20,7 +21,7 @@ module Goldiloader
20
21
 
21
22
  # See https://github.com/rails/rails/pull/32375
22
23
  def self.destroyed_model_associations_eager_loadable?
23
- PRE_RAILS_5_2
24
+ RAILS_5_2_0
24
25
  end
25
26
 
26
27
  def self.from_eager_loadable?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Goldiloader
4
- VERSION = '3.0.0'
4
+ VERSION = '3.0.1'
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: 3.0.0
4
+ version: 3.0.1
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-10-31 00:00:00.000000000 Z
11
+ date: 2018-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord