Permalink
Browse files

downcase table names in aliased_table_name_for and references_eager_l…

…oaded_tables? methods (as Oracle quoted table names are in uppercase)
  • Loading branch information...
1 parent 464b7f3 commit a83e6b1b6aa8ee67a47658ed27481e38aa2a62da @rsim rsim committed Feb 14, 2010
Showing with 4 additions and 2 deletions.
  1. +4 −2 activerecord/lib/active_record/relation.rb
@@ -356,13 +356,15 @@ def with_create_scope
end
def references_eager_loaded_tables?
- joined_tables = (tables_in_string(arel.joins(arel)) + [table.name, table.table_alias]).compact.uniq
+ # always convert table names to downcase as in Oracle quoted table names are in uppercase
+ joined_tables = (tables_in_string(arel.joins(arel)) + [table.name, table.table_alias]).compact.map(&:downcase).uniq
(tables_in_string(to_sql) - joined_tables).any?
end
def tables_in_string(string)
return [] if string.blank?
- string.scan(/([a-zA-Z_][\.\w]+).?\./).flatten.uniq
+ # always convert table names to downcase as in Oracle quoted table names are in uppercase
+ string.scan(/([a-zA-Z_][\.\w]+).?\./).flatten.map(&:downcase).uniq
end
end

0 comments on commit a83e6b1

Please sign in to comment.