preload 2.1.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 17b0e722000f6ae6740ff9860e3c445aac029b4f22c48aba48b611eaa77c2ec0
4
- data.tar.gz: 1ce717aa73e87869ecae47964a7f98718bcd19c1f6b0478ee262bf39294c1d31
3
+ metadata.gz: 91403dd9c08981e09b6ecad33db7c3315d3ad3c9029f554558881947c1744de5
4
+ data.tar.gz: ec2426fc9b71531a6e7da70962ef3e3b3f5ca6257b16ce614726371a76f6f5be
5
5
  SHA512:
6
- metadata.gz: f30711f254107db81f33edf53f7df7d800b90bdbdf77d0a55c905491860b3496ef0b99634c1779decf12a65c9aeceee6d5dd31a3bb58bf22c63b36ed73f7ab71
7
- data.tar.gz: 8af641b1d0aba627d6d529e72d667578ca5b3a91599a03e5cc41d800e8e2d7362052fa6e7cc1ec8a5e370ae4787ec0ea7eac956bf121f8580ddc88270a2f0618
6
+ metadata.gz: c8c955cdfca5a29a93f57cb2ed6bc3365f1f34ddb215ce63838b680273c5622a284379d1c3194897305988aa21b7dbc3b10dfb63465ca279f179322d06f0131c
7
+ data.tar.gz: 2f1144241f5da5f4dfc713e7629138f1d7f1d3ad1cdc2e27810f098d03c1c189ebd5b3f58242a45b7d2ab8cf1c50976d9e8460075ccff9964f8377465b5ae96a
@@ -5,12 +5,10 @@ module Preload
5
5
  def pre_load(*associations)
6
6
  return if empty?
7
7
 
8
- if ActiveRecord::VERSION::MAJOR >= 4
8
+ if ActiveRecord::VERSION::MAJOR >= 7
9
+ ActiveRecord::Associations::Preloader.new(records: self, associations: associations).call
10
+ elsif ActiveRecord::VERSION::MAJOR >= 5
9
11
  ActiveRecord::Associations::Preloader.new.preload(self, associations)
10
- elsif defined?(ActiveRecord::Associations::Preloader)
11
- ActiveRecord::Associations::Preloader.new(self, associations).run
12
- elsif ActiveRecord::Base.respond_to?(:preload_associations, true)
13
- first.class.send(:preload_associations, self, associations)
14
12
  else
15
13
  raise "Unsupported version of ActiveRecord"
16
14
  end
@@ -1,3 +1,3 @@
1
1
  module Preload
2
- VERSION = "2.1.0"
2
+ VERSION = "2.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: preload
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mick Staugaard
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-19 00:00:00.000000000 Z
11
+ date: 2022-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -16,20 +16,20 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '3.2'
19
+ version: '5.0'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '6.1'
22
+ version: '7.1'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '3.2'
29
+ version: '5.0'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '6.1'
32
+ version: '7.1'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: wwtd
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -114,7 +114,7 @@ dependencies:
114
114
  - - ">="
115
115
  - !ruby/object:Gem::Version
116
116
  version: '0'
117
- description:
117
+ description:
118
118
  email:
119
119
  - mick@staugaard.com
120
120
  executables: []
@@ -128,7 +128,7 @@ homepage: https://github.com/zendesk/preload
128
128
  licenses:
129
129
  - MIT
130
130
  metadata: {}
131
- post_install_message:
131
+ post_install_message:
132
132
  rdoc_options: []
133
133
  require_paths:
134
134
  - lib
@@ -143,8 +143,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
143
  - !ruby/object:Gem::Version
144
144
  version: '0'
145
145
  requirements: []
146
- rubygems_version: 3.0.3
147
- signing_key:
146
+ rubygems_version: 3.1.6
147
+ signing_key:
148
148
  specification_version: 4
149
149
  summary: A better API for ActiveRecord eager loading
150
150
  test_files: []