From 03fadebe0ed1fd384a14e46ba4c828b9a36ab4bf Mon Sep 17 00:00:00 2001 From: Gannon McGibbon Date: Wed, 28 Nov 2018 16:15:21 -0500 Subject: Allow spaces in postgres table names Fixes issue where "user post" is misinterpreted as "\"user\".\"post\"" when quoting table names with the postgres adapter. --- activerecord/lib/active_record/connection_adapters/postgresql/utils.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/connection_adapters/postgresql/utils.rb') diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/utils.rb b/activerecord/lib/active_record/connection_adapters/postgresql/utils.rb index bfd300723d..f2f4701500 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql/utils.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql/utils.rb @@ -68,7 +68,7 @@ module ActiveRecord # * "schema_name".table_name # * "schema.name"."table name" def extract_schema_qualified_name(string) - schema, table = string.scan(/[^".\s]+|"[^"]*"/) + schema, table = string.scan(/[^".]+|"[^"]*"/) if table.nil? table = schema schema = nil -- cgit v1.2.3