diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-01-05 14:58:28 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-01-05 14:58:28 +0000 |
commit | ebe3a0d532152d47f270ffaa0e11b994f4a8b177 (patch) | |
tree | d25ff07781cc30994316e9e34378ffea8725cf00 /activerecord/lib/active_record/associations/has_one_association.rb | |
parent | 139b92495fa7697cdd619c549d4c7b263562b761 (diff) | |
download | rails-ebe3a0d532152d47f270ffaa0e11b994f4a8b177.tar.gz rails-ebe3a0d532152d47f270ffaa0e11b994f4a8b177.tar.bz2 rails-ebe3a0d532152d47f270ffaa0e11b994f4a8b177.zip |
More thoroughly quote table names. Exposes some issues with sqlite2 adapter. Closes #10698.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8571 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record/associations/has_one_association.rb')
-rw-r--r-- | activerecord/lib/active_record/associations/has_one_association.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/associations/has_one_association.rb b/activerecord/lib/active_record/associations/has_one_association.rb index 085de27cd5..312cc1e487 100644 --- a/activerecord/lib/active_record/associations/has_one_association.rb +++ b/activerecord/lib/active_record/associations/has_one_association.rb @@ -61,10 +61,10 @@ module ActiveRecord case when @reflection.options[:as] @finder_sql = - "#{@reflection.klass.table_name}.#{@reflection.options[:as]}_id = #{@owner.quoted_id} AND " + - "#{@reflection.klass.table_name}.#{@reflection.options[:as]}_type = #{@owner.class.quote_value(@owner.class.base_class.name.to_s)}" + "#{@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.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 |