associationist 0.1.4 → 0.1.5
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
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a186e1fe166c48b9bafc22d84e421eb54b558fe3e004bb72ab8447d4e0ddf431
|
4
|
+
data.tar.gz: 39f5280cbc21527d1fc9f67e841ab9f8c1f40ef96a67012ee6967274de2903e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e769a4f0a5e5c4ea3d8c8a00ac1b2f06d4072e575a4e6131c0256a1846a6fbc0ddd6f0fb3f58a2ff0b9584a93946abc29bc5e12652969c49fb60c4e372abb07
|
7
|
+
data.tar.gz: bf4d00764a6deaebe802f2b60e2f0a8bed901abd50a244d47e421d2a7243f2dacdad36e849dcc2bb26188a2dff432f9c2697aa5a089b724ec15446f9561ae0dd
|
@@ -7,7 +7,8 @@ module Associationist
|
|
7
7
|
@reflection = reflection
|
8
8
|
end
|
9
9
|
|
10
|
-
|
10
|
+
# handle >= 6.0
|
11
|
+
def run preloader = nil
|
11
12
|
case
|
12
13
|
when @reflection.config.preloader_proc
|
13
14
|
@reflection.config.preloader_proc.call(@owners).each do |record, value|
|
@@ -29,6 +30,7 @@ module Associationist
|
|
29
30
|
end
|
30
31
|
end
|
31
32
|
end
|
33
|
+
self
|
32
34
|
end
|
33
35
|
|
34
36
|
def preloaded_records
|
@@ -18,7 +18,12 @@ module Associationist
|
|
18
18
|
|
19
19
|
validate_options(options)
|
20
20
|
|
21
|
-
|
21
|
+
case
|
22
|
+
when ActiveRecord.version >= Gem::Version.new('6.0.0')
|
23
|
+
scope = build_scope(scope)
|
24
|
+
else
|
25
|
+
scope = build_scope(scope, extension)
|
26
|
+
end
|
22
27
|
Reflection::CollectionReflection.new(name, scope, options, model)
|
23
28
|
end
|
24
29
|
end
|
@@ -25,7 +25,12 @@ module Associationist
|
|
25
25
|
raise ArgumentError, "association names must be a Symbol" unless name.kind_of?(Symbol)
|
26
26
|
|
27
27
|
validate_options(options)
|
28
|
-
|
28
|
+
case
|
29
|
+
when ActiveRecord.version >= Gem::Version.new('6.0.0')
|
30
|
+
scope = build_scope(scope)
|
31
|
+
else
|
32
|
+
scope = build_scope(scope, extension)
|
33
|
+
end
|
29
34
|
Reflection::SingularReflection.new(name, scope, options, model)
|
30
35
|
end
|
31
36
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: associationist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- CicholGricenchos
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '5.0'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '6'
|
22
|
+
version: '6.1'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '5.0'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '6'
|
32
|
+
version: '6.1'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: pry
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -123,8 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
requirements: []
|
126
|
-
|
127
|
-
rubygems_version: 2.5.2.3
|
126
|
+
rubygems_version: 3.0.1
|
128
127
|
signing_key:
|
129
128
|
specification_version: 4
|
130
129
|
summary: ''
|