From afb786ad8a27ae593790a5788441a9083a516195 Mon Sep 17 00:00:00 2001 From: Kris Selden Date: Fri, 26 Mar 2010 15:21:55 -0700 Subject: In PostgreSQLAdapter, switch tables query to use current_schemas function [#918 state:resolved] Signed-off-by: wycats --- .../lib/active_record/connection_adapters/postgresql_adapter.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index b3ce8c79dd..c9a5f00dfd 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -651,14 +651,12 @@ module ActiveRecord end end - # Returns the list of all tables in the schema search path or a specified schema. def tables(name = nil) - schemas = schema_search_path.split(/,/).map { |p| quote(p) }.join(',') query(<<-SQL, name).map { |row| row[0] } SELECT tablename FROM pg_tables - WHERE schemaname IN (#{schemas}) + WHERE schemaname = ANY (current_schemas(false)) SQL end -- cgit v1.2.3