diff options
author | Sean Griffin <sean@thoughtbot.com> | 2015-02-07 14:10:58 -0700 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2015-02-07 14:10:58 -0700 |
commit | 7e93e33c1980ea3d08cec9708d2737f1c8d0a10a (patch) | |
tree | b1908acbff6c445b8f4b2a36ea735aa30deb7d4a /activerecord | |
parent | 631707a572fe14f3bbea2779cc97fcc581048d62 (diff) | |
download | rails-7e93e33c1980ea3d08cec9708d2737f1c8d0a10a.tar.gz rails-7e93e33c1980ea3d08cec9708d2737f1c8d0a10a.tar.bz2 rails-7e93e33c1980ea3d08cec9708d2737f1c8d0a10a.zip |
rm `ActiveRecord::Type::Decorator`
It only existed to make sure the subclasses of `Delegator` were YAML
serializable. As of Ruby 2.2, these are YAML dumpable by default, as it
includes
https://github.com/tenderlove/psych/commit/2a4d9568f7d5d19c00231cf48eb855cc45ec3394
Diffstat (limited to 'activerecord')
4 files changed, 0 insertions, 28 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb b/activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb index 565ecddde5..90c36e4b02 100644 --- a/activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb +++ b/activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb @@ -2,8 +2,6 @@ module ActiveRecord module AttributeMethods module TimeZoneConversion class TimeZoneConverter < DelegateClass(Type::Value) # :nodoc: - include Type::Decorator - def type_cast_from_database(value) convert_time_to_time_zone(super) end diff --git a/activerecord/lib/active_record/type.rb b/activerecord/lib/active_record/type.rb index 5678b9c84c..1f978a17c5 100644 --- a/activerecord/lib/active_record/type.rb +++ b/activerecord/lib/active_record/type.rb @@ -1,5 +1,4 @@ require 'active_record/type/helpers' -require 'active_record/type/decorator' require 'active_record/type/mutable' require 'active_record/type/numeric' require 'active_record/type/time_value' diff --git a/activerecord/lib/active_record/type/decorator.rb b/activerecord/lib/active_record/type/decorator.rb deleted file mode 100644 index 9fce38ea44..0000000000 --- a/activerecord/lib/active_record/type/decorator.rb +++ /dev/null @@ -1,14 +0,0 @@ -module ActiveRecord - module Type - module Decorator # :nodoc: - def init_with(coder) - @subtype = coder['subtype'] - __setobj__(@subtype) - end - - def encode_with(coder) - coder['subtype'] = __getobj__ - end - end - end -end diff --git a/activerecord/lib/active_record/type/serialized.rb b/activerecord/lib/active_record/type/serialized.rb index 3cac03464e..c1ca5fd936 100644 --- a/activerecord/lib/active_record/type/serialized.rb +++ b/activerecord/lib/active_record/type/serialized.rb @@ -2,7 +2,6 @@ module ActiveRecord module Type class Serialized < DelegateClass(Type::Value) # :nodoc: include Mutable - include Decorator attr_reader :subtype, :coder @@ -36,16 +35,6 @@ module ActiveRecord ActiveRecord::Store::IndifferentHashAccessor end - def init_with(coder) - @coder = coder['coder'] - super - end - - def encode_with(coder) - coder['coder'] = @coder - super - end - private def default_value?(value) |