goldiloader 2.1.0 → 2.1.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 +2 -2
- data/lib/goldiloader/compatibility.rb +13 -0
- 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: 7d32eaea199d074ab8988ec521e8a4ee67a0bf55
|
4
|
+
data.tar.gz: 57c03bce045cb49c4aa70e47486ef36c56da654f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: deab2653b8827c4b58b284229e87fc8af127c56101551e0e6b20c709c258f5c6713d998906308a6dd16bd00aab228ecc5bb4b1a255773722d5ccf74568c30cf1
|
7
|
+
data.tar.gz: 54cca5bde1209f5f413a6bdd4f98fd286626022ecb03c23ccbde6de6c9cf34b0fe684507d5d1def4d91e14614737c3783eb322097592b51d68f145f89d71624c
|
@@ -100,8 +100,8 @@ module Goldiloader
|
|
100
100
|
association_info = Goldiloader::AssociationInfo.new(self)
|
101
101
|
!association_info.limit? &&
|
102
102
|
!association_info.offset? &&
|
103
|
-
!association_info.group? &&
|
104
|
-
!association_info.from? &&
|
103
|
+
(!association_info.group? || ::Goldiloader::Compatibility.group_eager_loadable?) &&
|
104
|
+
(!association_info.from? || ::Goldiloader::Compatibility.from_eager_loadable?) &&
|
105
105
|
!association_info.instance_dependent? &&
|
106
106
|
association_info.auto_include? &&
|
107
107
|
(!owner.destroyed? || ::Goldiloader::Compatibility.destroyed_model_associations_eager_loadable?)
|
@@ -4,6 +4,11 @@ module Goldiloader
|
|
4
4
|
module Compatibility
|
5
5
|
ACTIVE_RECORD_VERSION = ::Gem::Version.new(::ActiveRecord::VERSION::STRING)
|
6
6
|
PRE_RAILS_5_2 = ACTIVE_RECORD_VERSION < ::Gem::Version.new('5.2.0')
|
7
|
+
POST_RAILS_5_1_4 = ACTIVE_RECORD_VERSION > ::Gem::Version.new('5.1.5')
|
8
|
+
PRE_RAILS_5_1_5 = ACTIVE_RECORD_VERSION < ::Gem::Version.new('5.1.5')
|
9
|
+
FROM_EAGER_LOADABLE = ACTIVE_RECORD_VERSION >= ::Gem::Version.new('5.1.5') ||
|
10
|
+
(ACTIVE_RECORD_VERSION >= ::Gem::Version.new('5.0.7') && ACTIVE_RECORD_VERSION < ::Gem::Version.new('5.1.0'))
|
11
|
+
GROUP_EAGER_LOADABLE = FROM_EAGER_LOADABLE
|
7
12
|
|
8
13
|
def self.rails_4?
|
9
14
|
::ActiveRecord::VERSION::MAJOR == 4
|
@@ -17,5 +22,13 @@ module Goldiloader
|
|
17
22
|
def self.destroyed_model_associations_eager_loadable?
|
18
23
|
PRE_RAILS_5_2
|
19
24
|
end
|
25
|
+
|
26
|
+
def self.from_eager_loadable?
|
27
|
+
FROM_EAGER_LOADABLE
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.group_eager_loadable?
|
31
|
+
GROUP_EAGER_LOADABLE
|
32
|
+
end
|
20
33
|
end
|
21
34
|
end
|
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: 2.1.
|
4
|
+
version: 2.1.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-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|