aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorRaimonds Simanovskis <raimonds.simanovskis@gmail.com>2010-05-16 20:26:40 +0300
committerRaimonds Simanovskis <raimonds.simanovskis@gmail.com>2010-06-04 22:44:03 +0300
commitedf79a7fe7c78e291c06a6d8be3ae87dabde9afa (patch)
treeddbd66e139829674a4b1766a1e68fb020e66b113 /activerecord/lib
parent05ef038bb955d4a0c9cbda50bf7ff7eb259bdf59 (diff)
downloadrails-edf79a7fe7c78e291c06a6d8be3ae87dabde9afa.tar.gz
rails-edf79a7fe7c78e291c06a6d8be3ae87dabde9afa.tar.bz2
rails-edf79a7fe7c78e291c06a6d8be3ae87dabde9afa.zip
Downcase quoted table name in regex in count_aliases_from_table_joins
Oracle adapter's quote_table_name returns quoted table name in uppercase and therefore it should be downcased before scanning downcased join_sql
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-xactiverecord/lib/active_record/associations.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb
index 5b0ba86308..7d5fd8e96c 100755
--- a/activerecord/lib/active_record/associations.rb
+++ b/activerecord/lib/active_record/associations.rb
@@ -1755,7 +1755,8 @@ module ActiveRecord
end
def count_aliases_from_table_joins(name)
- quoted_name = join_base.active_record.connection.quote_table_name(name.downcase)
+ # quoted_name should be downcased as some database adapters (Oracle) return quoted name in uppercase
+ quoted_name = join_base.active_record.connection.quote_table_name(name.downcase).downcase
join_sql = join_base.table_joins.to_s.downcase
join_sql.blank? ? 0 :
# Table names