Permalink
Browse files

refactoring to_sym of Symbol in preload

  • Loading branch information...
acapilleri committed Jan 2, 2013
1 parent e443ac0 commit 0a9172f1908d26d013a851b8be6fe785c596b74f
Showing with 3 additions and 1 deletion.
  1. +3 −1 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"

0 comments on commit 0a9172f

Please sign in to comment.