Skip to content

Commit 5013d28

Browse files
authored
Merge pull request #159 from kbrock/klass_associations
Don't run preloader on double arrays
2 parents a289545 + 9726cd9 commit 5013d28

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/active_record/virtual_attributes/virtual_fields.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def call
159159
records_by_assoc.each do |klass_associations, klass_records|
160160
next if klass_associations.blank?
161161

162-
Array[klass_associations].each do |klass_association| # rubocop:disable Style/RedundantArrayConstructor
162+
Array.wrap(klass_associations).each do |klass_association|
163163
# this calls back into itself, but it will take the short circuit
164164
Preloader.new(:records => klass_records, :associations => klass_association, :scope => scope).call
165165
end

0 commit comments

Comments
 (0)