diff options
author | Gannon McGibbon <gannon.mcgibbon@gmail.com> | 2018-11-28 16:15:21 -0500 |
---|---|---|
committer | Gannon McGibbon <gannon.mcgibbon@gmail.com> | 2018-11-28 16:20:22 -0500 |
commit | 03fadebe0ed1fd384a14e46ba4c828b9a36ab4bf (patch) | |
tree | fd4d15d58bc7b3b8cfdf78a55e22793ccfcc1f89 /activerecord/lib/active_record | |
parent | 9c6e362a632b15dd4f56534b30144926c29fa323 (diff) | |
download | rails-03fadebe0ed1fd384a14e46ba4c828b9a36ab4bf.tar.gz rails-03fadebe0ed1fd384a14e46ba4c828b9a36ab4bf.tar.bz2 rails-03fadebe0ed1fd384a14e46ba4c828b9a36ab4bf.zip |
Allow spaces in postgres table names
Fixes issue where "user post" is misinterpreted as "\"user\".\"post\""
when quoting table names with the postgres adapter.
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql/utils.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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 # * <tt>"schema_name".table_name</tt> # * <tt>"schema.name"."table name"</tt> def extract_schema_qualified_name(string) - schema, table = string.scan(/[^".\s]+|"[^"]*"/) + schema, table = string.scan(/[^".]+|"[^"]*"/) if table.nil? table = schema schema = nil |