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 +4 -4
- data/lib/goldiloader/active_record_patches.rb +6 -6
- data/lib/goldiloader/compatibility.rb +2 -1
- data/lib/goldiloader/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: ddfe79d8e20eeabfb358028da2573e4841c54e28
|
4
|
+
data.tar.gz: 3c3ef465fe8ac265cde235af7a0f6ea7694c78f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
101
|
+
association_info.auto_include? &&
|
102
|
+
!association_info.limit? &&
|
102
103
|
!association_info.offset? &&
|
103
104
|
(!association_info.has_one? || !association_info.order?) &&
|
104
|
-
(
|
105
|
-
(
|
106
|
-
!
|
107
|
-
association_info.
|
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
|
-
|
24
|
+
RAILS_5_2_0
|
24
25
|
end
|
25
26
|
|
26
27
|
def self.from_eager_loadable?
|
data/lib/goldiloader/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2018-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|