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 +4 -4
- data/lib/goldiloader/active_record_patches.rb +7 -7
- data/lib/goldiloader/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f884bb718c29de33bdabce3826ecd6f8551ce9cdbb4089ce604ee7c7ac49b49
|
4
|
+
data.tar.gz: 32edcdf13f8a4027f2803e6ed485f441b0e2e8589f4f9db9bff914dd237069ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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(
|
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(
|
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
|
data/lib/goldiloader/version.rb
CHANGED
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.
|
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-
|
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: '
|
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: '
|
226
|
+
version: '2.0'
|
227
227
|
description: Automatically eager loads Rails associations as associations are traversed
|
228
228
|
email:
|
229
229
|
- jturkel@salsify.com
|