aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-06-17 22:59:12 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-06-17 22:59:12 -0300
commitbdc39899ebb2a17e91cfde1803da3d1170531f04 (patch)
treee9bafb7f42fc28bbc1956ce61c17b14aaec935da /activerecord/test
parent84a13e019e93efaa8994b3f8303d635a7702dbce (diff)
parent455c692b047ad1af1670b5377a1c4313ad0d1228 (diff)
downloadrails-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.rb11
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