diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-06-17 22:59:12 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-06-17 22:59:12 -0300 |
commit | bdc39899ebb2a17e91cfde1803da3d1170531f04 (patch) | |
tree | e9bafb7f42fc28bbc1956ce61c17b14aaec935da /activerecord/test | |
parent | 84a13e019e93efaa8994b3f8303d635a7702dbce (diff) | |
parent | 455c692b047ad1af1670b5377a1c4313ad0d1228 (diff) | |
download | rails-bdc39899ebb2a17e91cfde1803da3d1170531f04.tar.gz rails-bdc39899ebb2a17e91cfde1803da3d1170531f04.tar.bz2 rails-bdc39899ebb2a17e91cfde1803da3d1170531f04.zip |
Merge pull request #15790 from sgrif/sg-mutable-points
Detect in-place changes on point types
Diffstat (limited to 'activerecord/test')
-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 |