diff options
author | Andre Arko <andre@arko.net> | 2008-06-04 13:58:58 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-06-25 19:04:09 -0700 |
commit | 0b12da44aa35b643b17ab1b61634ff952993e357 (patch) | |
tree | 6774141167461cc920922b532274866726eb67aa /activerecord/lib/active_record/associations/has_one_association.rb | |
parent | a93ea88c0623b4f65af98c0eb55924c335bb3ac1 (diff) | |
download | rails-0b12da44aa35b643b17ab1b61634ff952993e357.tar.gz rails-0b12da44aa35b643b17ab1b61634ff952993e357.tar.bz2 rails-0b12da44aa35b643b17ab1b61634ff952993e357.zip |
Extract owner_quoted_id so it can be overridden. [#292 state:committed]
Diffstat (limited to 'activerecord/lib/active_record/associations/has_one_association.rb')
-rwxr-xr-x | activerecord/lib/active_record/associations/has_one_association.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/has_one_association.rb b/activerecord/lib/active_record/associations/has_one_association.rb index c2b3503e0d..25a268e95c 100755 --- a/activerecord/lib/active_record/associations/has_one_association.rb +++ b/activerecord/lib/active_record/associations/has_one_association.rb @@ -63,10 +63,10 @@ module ActiveRecord case 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]}_id = #{owner_quoted_id} AND " + "#{@reflection.quoted_table_name}.#{@reflection.options[:as]}_type = #{@owner.class.quote_value(@owner.class.base_class.name.to_s)}" else - @finder_sql = "#{@reflection.quoted_table_name}.#{@reflection.primary_key_name} = #{@owner.quoted_id}" + @finder_sql = "#{@reflection.quoted_table_name}.#{@reflection.primary_key_name} = #{owner_quoted_id}" end @finder_sql << " AND (#{conditions})" if conditions end |