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/test | |
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/test')
-rw-r--r-- | activerecord/test/cases/adapters/postgresql/quoting_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/quoting_test.rb b/activerecord/test/cases/adapters/postgresql/quoting_test.rb index d50dc49276..d571355a9c 100644 --- a/activerecord/test/cases/adapters/postgresql/quoting_test.rb +++ b/activerecord/test/cases/adapters/postgresql/quoting_test.rb @@ -39,6 +39,11 @@ module ActiveRecord type = OID::Bit.new assert_nil @conn.quote(type.serialize(value)) end + + def test_quote_table_name_with_spaces + value = "user posts" + assert_equal "\"user posts\"", @conn.quote_table_name(value) + end end end end |