goldiloader 5.3.0 → 5.3.1

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: 3faf77c5a49c5d76b36f9bb124bf470d6f936b9e8a8df225e049967659f4f19b
4
- data.tar.gz: 45e0492000d0fffc306b7f06c2f34b65d11f0a80323b394d320664ab96046f56
3
+ metadata.gz: 1f884bb718c29de33bdabce3826ecd6f8551ce9cdbb4089ce604ee7c7ac49b49
4
+ data.tar.gz: 32edcdf13f8a4027f2803e6ed485f441b0e2e8589f4f9db9bff914dd237069ef
5
5
  SHA512:
6
- metadata.gz: 41a1b471723660aaacd9cf55e3f1f0de1289c44f89dd70a7f0876b8a2d076ab24c123be2907a52b33f932942b717ac9977178dbc3a95a01f0538474dad802eed
7
- data.tar.gz: c9a4ddd6375a7d56020b163a8d0f0c9a4541e1cfc1c9ef78014a136b6611375b7a945ab952f3993948cb77c6b004837f7a8c91ab5ce8c4f8c69f993379ac7114
6
+ metadata.gz: 55682f49532c821dc4b0658e05d2aadc4922d38492fe240510fcb1f0c87fdc2dff3bd4eab8a4de398f12ee34032e6648e39b17e28d938a74f5c617184a59e0e4
7
+ data.tar.gz: a42db8caf9b803b6ef2f6dc11e74018e212e06cb24d1b644760e03b325224a63ad63393f348071319a4970de219e42e93d93a483249ec350faa432d85a14d6e4
@@ -152,7 +152,7 @@ module Goldiloader
152
152
  module SingularAssociationPatch
153
153
  private
154
154
 
155
- def find_target(*args)
155
+ def find_target(...)
156
156
  load_with_auto_include { super }
157
157
  end
158
158
  end
@@ -161,13 +161,13 @@ module Goldiloader
161
161
  module CollectionAssociationPatch
162
162
  # Force these methods to load the entire association for fully_load associations
163
163
  [:size, :ids_reader, :empty?].each do |method|
164
- define_method(method) do |*args, &block|
164
+ define_method(method) do |*args, **kwargs, &block|
165
165
  load_target if fully_load?
166
- super(*args, &block)
166
+ super(*args, **kwargs, &block)
167
167
  end
168
168
  end
169
169
 
170
- def load_target(*args)
170
+ def load_target(...)
171
171
  load_with_auto_include { super }
172
172
  end
173
173
 
@@ -203,14 +203,14 @@ module Goldiloader
203
203
  module CollectionProxyPatch
204
204
  # The CollectionProxy just forwards exists? to the underlying scope so we need to intercept this and
205
205
  # force it to use size which handles fully_load properly.
206
- def exists?(*args)
206
+ def exists?(*args, **kwargs)
207
207
  # We don't fully_load the association when arguments are passed to exists? since Rails always
208
208
  # pushes this query into the database without any caching (and it likely not a common
209
209
  # scenario worth optimizing).
210
- if args.empty? && @association.fully_load?
210
+ if args.empty? && kwargs.empty? && @association.fully_load?
211
211
  size > 0
212
212
  else
213
- scope.exists?(*args)
213
+ scope.exists?(*args, **kwargs)
214
214
  end
215
215
  end
216
216
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Goldiloader
4
- VERSION = '5.3.0'
4
+ VERSION = '5.3.1'
5
5
  end
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: 5.3.0
4
+ version: 5.3.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: 2024-08-15 00:00:00.000000000 Z
11
+ date: 2024-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -216,14 +216,14 @@ dependencies:
216
216
  requirements:
217
217
  - - "~>"
218
218
  - !ruby/object:Gem::Version
219
- version: '1.4'
219
+ version: '2.0'
220
220
  type: :development
221
221
  prerelease: false
222
222
  version_requirements: !ruby/object:Gem::Requirement
223
223
  requirements:
224
224
  - - "~>"
225
225
  - !ruby/object:Gem::Version
226
- version: '1.4'
226
+ version: '2.0'
227
227
  description: Automatically eager loads Rails associations as associations are traversed
228
228
  email:
229
229
  - jturkel@salsify.com