diff options
author | Sean Griffin <sean@thoughtbot.com> | 2014-06-17 19:55:59 -0600 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2014-06-17 19:55:59 -0600 |
commit | 455c692b047ad1af1670b5377a1c4313ad0d1228 (patch) | |
tree | 4990edf4a0f2dbd17ecebd4efec8b8180803a132 /activerecord/test/cases/adapters/postgresql | |
parent | 3999f9cf0f16585ecd0e8bcd3bc482b46779e8cb (diff) | |
download | rails-455c692b047ad1af1670b5377a1c4313ad0d1228.tar.gz rails-455c692b047ad1af1670b5377a1c4313ad0d1228.tar.bz2 rails-455c692b047ad1af1670b5377a1c4313ad0d1228.zip |
Detect in-place changes on point types
Diffstat (limited to 'activerecord/test/cases/adapters/postgresql')
-rw-r--r-- | activerecord/test/cases/adapters/postgresql/geometric_test.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/geometric_test.rb b/activerecord/test/cases/adapters/postgresql/geometric_test.rb index 2f106ee664..aa737617c4 100644 --- a/activerecord/test/cases/adapters/postgresql/geometric_test.rb +++ b/activerecord/test/cases/adapters/postgresql/geometric_test.rb @@ -61,4 +61,15 @@ class PostgresqlPointTest < ActiveRecord::TestCase assert record.reload assert_equal [1.1, 2.2], record.x end + + def test_mutation + p = PostgresqlPoint.create! x: [10, 20] + + p.x[1] = 25 + p.save! + p.reload + + assert_equal [10.0, 25.0], p.x + assert_not p.changed? + end end |