diff options
author | Ruy Asan <ruyasan@gmail.com> | 2009-05-01 13:09:29 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-05-01 14:47:56 -0700 |
commit | 99c103be1165da9c8299bc0977188ecf167e06a5 (patch) | |
tree | f57524e693656e67f09173f130dbc174b298daf6 /activerecord/lib | |
parent | db0bfe4ede3cdfc2e4ccdb2a89525a914e6d0913 (diff) | |
download | rails-99c103be1165da9c8299bc0977188ecf167e06a5.tar.gz rails-99c103be1165da9c8299bc0977188ecf167e06a5.tar.bz2 rails-99c103be1165da9c8299bc0977188ecf167e06a5.zip |
Fixed bug with polymorphic has_one :as pointing to an STI record
[#2594 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/associations/has_one_association.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/has_one_association.rb b/activerecord/lib/active_record/associations/has_one_association.rb index b92cbbdeab..1464227bb0 100644 --- a/activerecord/lib/active_record/associations/has_one_association.rb +++ b/activerecord/lib/active_record/associations/has_one_association.rb @@ -88,7 +88,7 @@ module ActiveRecord when @reflection.options[:as] @finder_sql = "#{@reflection.quoted_table_name}.#{@reflection.options[:as]}_id = #{owner_quoted_id} AND " + - "#{@reflection.quoted_table_name}.#{@reflection.options[:as]}_type = #{@owner.class.quote_value(@owner.class.base_class.name.to_s)}" + "#{@reflection.quoted_table_name}.#{@reflection.options[:as]}_type = #{@owner.class.quote_value(@owner.class.name.to_s)}" else @finder_sql = "#{@reflection.quoted_table_name}.#{@reflection.primary_key_name} = #{owner_quoted_id}" end |