Skip to content
Browse files

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
  • Loading branch information...
1 parent 05ef038 commit edf79a7fe7c78e291c06a6d8be3ae87dabde9afa @rsim rsim committed May 16, 2010
Showing with 2 additions and 1 deletion.
  1. +2 −1 activerecord/lib/active_record/associations.rb
View
3 activerecord/lib/active_record/associations.rb
@@ -1755,7 +1755,8 @@ def join_base
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

0 comments on commit edf79a7

Please sign in to comment.
Something went wrong with that request. Please try again.