Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #8691 from acapilleri/preload_association

refactoring to_sym of Symbol in preload
  • Loading branch information...
commit 1fd7971af77590979af2b1a894f7ad8e64df009e 2 parents fb61a80 + 0a9172f
@rafaelfranca rafaelfranca authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 activerecord/lib/active_record/associations/preloader.rb
View
4 activerecord/lib/active_record/associations/preloader.rb
@@ -100,7 +100,9 @@ def preload(association)
case association
when Hash
preload_hash(association)
- when String, Symbol
+ when Symbol
+ preload_one(association)
+ when String
preload_one(association.to_sym)
else
raise ArgumentError, "#{association.inspect} was not recognised for preload"
Please sign in to comment.
Something went wrong with that request. Please try again.