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
- SHA1:
3
- metadata.gz: 86629357a2894bef36a64e5b1509b7e9a15cef85
4
- data.tar.gz: 943b4fe8c567c4c92d638efe961b8f07146843b9
2
+ SHA256:
3
+ metadata.gz: a186e1fe166c48b9bafc22d84e421eb54b558fe3e004bb72ab8447d4e0ddf431
4
+ data.tar.gz: 39f5280cbc21527d1fc9f67e841ab9f8c1f40ef96a67012ee6967274de2903e1
5
5
  SHA512:
6
- metadata.gz: 0a4b7c799474d1aff7511a8f77f4993b1f7cc70d59a0f83974cef653ae775bdc6636580046ef1ac8a912d90f3524a5ebcc0a26b04557999617354d6240ad5285
7
- data.tar.gz: ad01edca0cd23d63c53165f6fccb5bf22ee41aa16c1e3abbf38e4fdafaae50a629749e36f1c9a56d2fdb41063a611594a3d6531c26dd966076113f1711029f33
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
- def run preloader
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
- scope = build_scope(scope, extension)
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
- scope = build_scope(scope, extension)
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
 
@@ -1,3 +1,3 @@
1
1
  module Associationist
2
- VERSION = '0.1.4'
2
+ VERSION = '0.1.5'
3
3
  end
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
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-07-10 00:00:00.000000000 Z
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
- rubyforge_project:
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: ''