Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removing dead code. attribute_cast_code is not called.

  • Loading branch information...
commit 5fef8c174ad45fd1a381975816debf8446d09db0 1 parent 1b73dbd
@kennyj kennyj authored
View
10 activerecord/lib/active_record/attribute_methods/serialization.rb
@@ -98,16 +98,6 @@ def initialize_attributes(attributes, options = {})
attributes
end
-
- private
-
- def attribute_cast_code(attr_name)
- if serialized_attributes.include?(attr_name)
- "v.unserialized_value"
- else
- super
- end
- end
end
def type_cast_attribute_for_write(column, value)
View
15 activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
@@ -34,21 +34,6 @@ def type
module ClassMethods
protected
- # The enhanced read method automatically converts the UTC time stored in the database to the time
- # zone stored in Time.zone.
- def attribute_cast_code(attr_name)
- column = columns_hash[attr_name]
-
- if create_time_zone_conversion_attribute?(attr_name, column)
- typecast = "v = #{super}"
- time_zone_conversion = "v.acts_like?(:time) ? v.in_time_zone : v"
-
- "((#{typecast}) && (#{time_zone_conversion}))"
- else
- super
- end
- end
-
# Defined for all +datetime+ and +timestamp+ attributes when +time_zone_aware_attributes+ are enabled.
# This enhanced write method will automatically convert the time passed to it to the zone stored in Time.zone.
def define_method_attribute=(attr_name)

0 comments on commit 5fef8c1

Please sign in to comment.
Something went wrong with that request. Please try again.