diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-11-04 11:16:55 +0000 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-11-04 11:17:56 +0000 |
commit | e6cc2ea201857a5f3700f589336df2880564cfea (patch) | |
tree | e05f67885b8201f74b9284f6dc1497fd2c4d56ec /activerecord/lib/active_record | |
parent | 2c67845271f7bd800fa4f902e187c803ab61bb01 (diff) | |
download | rails-e6cc2ea201857a5f3700f589336df2880564cfea.tar.gz rails-e6cc2ea201857a5f3700f589336df2880564cfea.tar.bz2 rails-e6cc2ea201857a5f3700f589336df2880564cfea.zip |
Allow the :class_name option for associations to take a symbol.
This is to avoid confusing newbies, and to be consistent with the fact
that other options like :foreign_key already allow a symbol or a string.
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/reflection.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb index 98f0418d3f..52968070cb 100644 --- a/activerecord/lib/active_record/reflection.rb +++ b/activerecord/lib/active_record/reflection.rb @@ -124,7 +124,7 @@ module ActiveRecord # <tt>composed_of :balance, :class_name => 'Money'</tt> returns <tt>'Money'</tt> # <tt>has_many :clients</tt> returns <tt>'Client'</tt> def class_name - @class_name ||= options[:class_name] || derive_class_name + @class_name ||= (options[:class_name] || derive_class_name).to_s end # Returns +true+ if +self+ and +other_aggregation+ have the same +name+ attribute, +active_record+ attribute, |