From e950c4b4a503d801ac141c143171dbffe758e6eb Mon Sep 17 00:00:00 2001 From: Sean Griffin Date: Mon, 28 Sep 2015 16:10:23 -0400 Subject: Inline `Attribute#original_value` The external uses of this method have been removed, and I'd like to internally re-use that name, as I'm planning to encapsulate `changed?` into the attribute object itself. --- activerecord/lib/active_record/attribute.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'activerecord/lib/active_record/attribute.rb') diff --git a/activerecord/lib/active_record/attribute.rb b/activerecord/lib/active_record/attribute.rb index 21fe032a9c..74b44810d4 100644 --- a/activerecord/lib/active_record/attribute.rb +++ b/activerecord/lib/active_record/attribute.rb @@ -34,14 +34,10 @@ module ActiveRecord def value # `defined?` is cheaper than `||=` when we get back falsy values - @value = original_value unless defined?(@value) + @value = type_cast(value_before_type_cast) unless defined?(@value) @value end - def original_value - type_cast(value_before_type_cast) - end - def value_for_database type.serialize(value) end -- cgit v1.2.3