From 0a9172f1908d26d013a851b8be6fe785c596b74f Mon Sep 17 00:00:00 2001 From: Angelo capilleri Date: Wed, 2 Jan 2013 15:57:01 +0100 Subject: refactoring to_sym of Symbol in preload --- activerecord/lib/active_record/associations/preloader.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'activerecord/lib') 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" -- cgit v1.2.3