aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations/preloader.rb
diff options
context:
space:
mode:
authorAngelo capilleri <capilleri@yahoo.com>2013-01-02 15:57:01 +0100
committerAngelo capilleri <capilleri@yahoo.com>2013-01-02 15:57:01 +0100
commit0a9172f1908d26d013a851b8be6fe785c596b74f (patch)
treec503d1afcdd98d638e182154cb114f3678a4cde9 /activerecord/lib/active_record/associations/preloader.rb
parente443ac03a45e9444a688fcf840edd06aa361e9b0 (diff)
downloadrails-0a9172f1908d26d013a851b8be6fe785c596b74f.tar.gz
rails-0a9172f1908d26d013a851b8be6fe785c596b74f.tar.bz2
rails-0a9172f1908d26d013a851b8be6fe785c596b74f.zip
refactoring to_sym of Symbol in preload
Diffstat (limited to 'activerecord/lib/active_record/associations/preloader.rb')
-rw-r--r--activerecord/lib/active_record/associations/preloader.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/preloader.rb b/activerecord/lib/active_record/associations/preloader.rb
index 0848e7afb3..82bf426b22 100644
--- a/activerecord/lib/active_record/associations/preloader.rb
+++ b/activerecord/lib/active_record/associations/preloader.rb
@@ -100,7 +100,9 @@ module ActiveRecord
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"