diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2015-09-28 16:10:23 -0400 |
---|---|---|
committer | Sean Griffin <sean@seantheprogrammer.com> | 2015-09-28 16:26:50 -0400 |
commit | e950c4b4a503d801ac141c143171dbffe758e6eb (patch) | |
tree | ae1dfc0efcc5a14c61c19ba128833adb06d34dc8 /activerecord/lib/active_record/attribute.rb | |
parent | 8dbdf3f061d0ba7558524ee4e490ee69d1bd648f (diff) | |
download | rails-e950c4b4a503d801ac141c143171dbffe758e6eb.tar.gz rails-e950c4b4a503d801ac141c143171dbffe758e6eb.tar.bz2 rails-e950c4b4a503d801ac141c143171dbffe758e6eb.zip |
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.
Diffstat (limited to 'activerecord/lib/active_record/attribute.rb')
-rw-r--r-- | activerecord/lib/active_record/attribute.rb | 6 |
1 files changed, 1 insertions, 5 deletions
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 |