aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/associations.rb
diff options
context:
space:
mode:
authorKarthik Krishnan <info@karthiks.in>2008-12-20 20:52:48 +0000
committerPratik Naik <pratiknaik@gmail.com>2008-12-20 21:08:51 +0000
commit75a133f92ff7e27b83032babf829d8a58803bb3c (patch)
treeb6d68bff1f29febd1eb3b91987d6aaff9a4963fc /activerecord/lib/active_record/associations.rb
parentc092dbef50ba207174a94b7e0beb7782a3d86649 (diff)
downloadrails-75a133f92ff7e27b83032babf829d8a58803bb3c.tar.gz
rails-75a133f92ff7e27b83032babf829d8a58803bb3c.tar.bz2
rails-75a133f92ff7e27b83032babf829d8a58803bb3c.zip
Fix has many through not quoting table names [#1163 state:resolved]
Signed-off-by: Frederick Cheung <frederick.cheung@gmail.com>
Diffstat (limited to 'activerecord/lib/active_record/associations.rb')
-rwxr-xr-xactiverecord/lib/active_record/associations.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb
index 3cee9c7af2..07bc50c886 100755
--- a/activerecord/lib/active_record/associations.rb
+++ b/activerecord/lib/active_record/associations.rb
@@ -2198,7 +2198,7 @@ module ActiveRecord
protected
def aliased_table_name_for(name, suffix = nil)
- if !parent.table_joins.blank? && parent.table_joins.to_s.downcase =~ %r{join(\s+\w+)?\s+#{name.downcase}\son}
+ if !parent.table_joins.blank? && parent.table_joins.to_s.downcase =~ %r{join(\s+\w+)?\s+#{active_record.connection.quote_table_name name.downcase}\son}
@join_dependency.table_aliases[name] += 1
end