uberloader 0.2.0 → 0.3.0

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
2
  SHA256:
3
- metadata.gz: 8492bc8a8089cb6ece086e3b2b0f0827e8c52f59d7d26d6813153c0ea7d08193
4
- data.tar.gz: a9586e3880975bcbba4975bb969c3b0be354c6d8b51059cae77aae5d84ad86b9
3
+ metadata.gz: 0d7a5fee540e1317f8a7799b38c2b2b4a28fdf86381ca435d54b8a1cca9ef48a
4
+ data.tar.gz: a6703c0941ebc666faad5887ba3cd823ea0a31c689a206d77ea5db1d2cec4424
5
5
  SHA512:
6
- metadata.gz: d0a7b5dc7990d96df8c9075eff13283543f6e8dfc17eca55095a7a5ab7e629fdd1a0d4f31ecd68b5cc75c143bba73291e6638e410a446bd16f77e6c89aeffd92
7
- data.tar.gz: 5c595cbf5702da0a6f9fdd558ab6193efc33509de2c96ac61f95da1158e8a4d811ee11dd8ab59f4c81a15868ca2d10ede18d8d62f7869a23ca66a0bc25bec3f5
6
+ metadata.gz: d2dd6919e9074c17bd039d635284d7fef853f8844a14b51e9ee5e664aa5f3e22047b525e3118b61523e7eb5f523868e004a4082e1bb56998a825bb1d520d4081
7
+ data.tar.gz: ae5acc63757518f9d2d1868db983bb56952e8719ef091a0159850d74d1599a506293391a6ce4888b32f004be4f947042877c455d8d6109b2487b67290146232a
@@ -0,0 +1,9 @@
1
+ module Uberloader
2
+ module Preloader
3
+ def self.call(records, association, scope = nil)
4
+ ::ActiveRecord::Associations::Preloader
5
+ .new(records: records, associations: association, scope: scope)
6
+ .call
7
+ end
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module Uberloader
2
- VERSION = "0.2.0".freeze
2
+ VERSION = "0.3.0".freeze
3
3
  end
data/lib/uberloader.rb CHANGED
@@ -9,6 +9,7 @@ module Uberloader
9
9
 
10
10
  autoload :Preloader,
11
11
  case ActiveRecord::VERSION::MAJOR
12
+ when 8 then 'uberloader/preloader/v8'
12
13
  when 7 then 'uberloader/preloader/v7'
13
14
  when 6 then 'uberloader/preloader/v6'
14
15
  else raise "Unsupported ActiveRecord version"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uberloader
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordan Hollinger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-31 00:00:00.000000000 Z
11
+ date: 2024-12-14 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: '6.0'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '7.3'
22
+ version: '8.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: '6.0'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '7.3'
32
+ version: '8.1'
33
33
  description: Customizable SQL when preloading in ActiveRecord
34
34
  email: jordan.hollinger@gmail.com
35
35
  executables: []
@@ -42,6 +42,7 @@ files:
42
42
  - lib/uberloader/context.rb
43
43
  - lib/uberloader/preloader/v6.rb
44
44
  - lib/uberloader/preloader/v7.rb
45
+ - lib/uberloader/preloader/v8.rb
45
46
  - lib/uberloader/query_methods.rb
46
47
  - lib/uberloader/uberload.rb
47
48
  - lib/uberloader/version.rb