diff options
author | Joel <joel@renewfund.com> | 2012-02-08 14:21:10 -0800 |
---|---|---|
committer | Joel <joel@renewfund.com> | 2012-02-08 22:28:51 -0800 |
commit | 2dd0178229ccd5e7f19f120ded85fd4a80306cac (patch) | |
tree | bbde2521a8d7ed9848acba1b814054ad719a7bd7 /activerecord/test/cases | |
parent | 5b318a84e79d9b0a8276b382d076920befa03ca8 (diff) | |
download | rails-2dd0178229ccd5e7f19f120ded85fd4a80306cac.tar.gz rails-2dd0178229ccd5e7f19f120ded85fd4a80306cac.tar.bz2 rails-2dd0178229ccd5e7f19f120ded85fd4a80306cac.zip |
Also support writing the hstore back to the database
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/adapters/postgresql/hstore_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/hstore_test.rb b/activerecord/test/cases/adapters/postgresql/hstore_test.rb index 82c52b38a3..1644a58d92 100644 --- a/activerecord/test/cases/adapters/postgresql/hstore_test.rb +++ b/activerecord/test/cases/adapters/postgresql/hstore_test.rb @@ -86,6 +86,14 @@ class PostgresqlHstoreTest < ActiveRecord::TestCase assert_equal({"\"a"=>"q\"w"}, @column.type_cast('\"a=>q"w')) end + def test_rewrite + @connection.execute "insert into hstores (tags) VALUES ('1=>2')" + x = Hstore.find :first + x.tags = { '"a\'' => 'b' } + assert x.save! + end + + def test_select @connection.execute "insert into hstores (tags) VALUES ('1=>2')" x = Hstore.find :first |