Skip to content

Commit eb2aedb

Browse files
committed
Remove hash deconstruction
I don't think this hash deconstruction buys us much in terms of readability. We only need two parameters, the rest are ignored, and on top of that we have to allocate a hash. Convert to positional parameters instead.
1 parent 6878c50 commit eb2aedb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

activerecord/lib/active_record/railties/collection_cache_association_loading.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ def setup(context, options, as, block)
88

99
return super unless options[:cached]
1010

11-
@relation = relation_from_options(**options)
11+
@relation = relation_from_options(options[:partial], options[:collection])
1212

1313
super
1414
end
1515

16-
def relation_from_options(cached: nil, partial: nil, collection: nil, **_)
16+
def relation_from_options(partial, collection)
1717
relation = partial if partial.is_a?(ActiveRecord::Relation)
1818
relation ||= collection if collection.is_a?(ActiveRecord::Relation)
1919

0 commit comments

Comments
 (0)