From c51fa6bdfc202f78907a7d1cb6bce7b0e2562913 Mon Sep 17 00:00:00 2001 From: Raimonds Simanovskis Date: Mon, 17 May 2010 00:19:18 +0300 Subject: [PATCH] ignore raw_sql_ table alias that is used by Oracle adapter --- activerecord/lib/active_record/relation.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/activerecord/lib/active_record/relation.rb b/activerecord/lib/active_record/relation.rb index b6b4085ec0..99c914d7fc 100644 --- a/activerecord/lib/active_record/relation.rb +++ b/activerecord/lib/active_record/relation.rb @@ -364,7 +364,8 @@ module ActiveRecord def tables_in_string(string) return [] if string.blank? # 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 + # ignore raw_sql_ that is used by Oracle adapter as alias for limit/offset subqueries + string.scan(/([a-zA-Z_][\.\w]+).?\./).flatten.map(&:downcase).uniq - ['raw_sql_'] end end