aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2014-11-14 07:39:32 -0700
committerSean Griffin <sean@thoughtbot.com>2014-11-14 07:39:32 -0700
commit85b40edd949678abe2a50a4291029be123cb03c5 (patch)
tree374a5de80d0eed66854af2cddb2384ffe35a7305
parentee74d9c969140117293338fa61e35edcca07298d (diff)
downloadrails-85b40edd949678abe2a50a4291029be123cb03c5.tar.gz
rails-85b40edd949678abe2a50a4291029be123cb03c5.tar.bz2
rails-85b40edd949678abe2a50a4291029be123cb03c5.zip
Use `DelegateClass` instead of `SimpleDelegator` for type decorators
There is a significant performance difference between the two. Closes
-rw-r--r--activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb2
-rw-r--r--activerecord/lib/active_record/type/serialized.rb2
2 files changed, 2 insertions, 2 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 b7fe079ef5..33d9d2002c 100644
--- a/activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
+++ b/activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
@@ -1,7 +1,7 @@
module ActiveRecord
module AttributeMethods
module TimeZoneConversion
- class TimeZoneConverter < SimpleDelegator # :nodoc:
+ class TimeZoneConverter < DelegateClass(Type::Value) # :nodoc:
include Type::Decorator
def type_cast_from_database(value)
diff --git a/activerecord/lib/active_record/type/serialized.rb b/activerecord/lib/active_record/type/serialized.rb
index 17004b3593..3191a868ef 100644
--- a/activerecord/lib/active_record/type/serialized.rb
+++ b/activerecord/lib/active_record/type/serialized.rb
@@ -1,6 +1,6 @@
module ActiveRecord
module Type
- class Serialized < SimpleDelegator # :nodoc:
+ class Serialized < DelegateClass(Type::Value) # :nodoc:
include Mutable
include Decorator