提交 a83e6b1b 编写于 作者: R Raimonds Simanovskis

downcase table names in aliased_table_name_for and...

downcase table names in aliased_table_name_for and references_eager_loaded_tables? methods (as Oracle quoted table names are in uppercase)
上级 464b7f3d
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册