From 1dfd01475d93b8801df0a2933094b437a607e3e2 Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Sun, 17 Feb 2019 21:00:39 +0900 Subject: Extract duplicated `serialize` methods into helpers Since `serialize` is passed user input args (from `where`, schema default, etc), a helper should provide `serialize` if the helper also provide `cast`. Related #32624, 34cc301, a741208. --- activerecord/test/cases/base_test.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'activerecord/test') diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index 3168bf6977..63528d09d5 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -685,6 +685,9 @@ class BasicsTest < ActiveRecord::TestCase topic = Topic.find(1) topic.attributes = attributes assert_equal Time.local(2000, 1, 1, 5, 42, 0), topic.bonus_time + + topic.save! + assert_equal topic, Topic.find_by(attributes) end end -- cgit v1.2.3