From 990322b298c41b65be01238c56e2d7ff0dd76cb6 Mon Sep 17 00:00:00 2001 From: Sean Griffin Date: Tue, 26 Aug 2014 08:43:04 -0600 Subject: Correctly detect mutation on serialized columns mapping to binary Fixes #16701 --- activerecord/test/cases/dirty_test.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'activerecord/test') diff --git a/activerecord/test/cases/dirty_test.rb b/activerecord/test/cases/dirty_test.rb index 0c77eedb52..5cb6b97117 100644 --- a/activerecord/test/cases/dirty_test.rb +++ b/activerecord/test/cases/dirty_test.rb @@ -682,6 +682,22 @@ class DirtyTest < ActiveRecord::TestCase assert_not pirate.changed? end + test "in place mutation for binary" do + klass = Class.new(ActiveRecord::Base) do + self.table_name = :binaries + serialize :data + end + + klass.create!(data: "foo") + binary = klass.first + + assert_not binary.changed? + + binary.data << "bar" + + assert binary.changed? + end + private def with_partial_writes(klass, on = true) old = klass.partial_writes? -- cgit v1.2.3