Skip to content

Commit

Permalink
Removing dead code. attribute_cast_code is not called.
Browse files Browse the repository at this point in the history
  • Loading branch information
kennyj committed Sep 27, 2012
1 parent 1b73dbd commit 5fef8c1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
10 changes: 0 additions & 10 deletions activerecord/lib/active_record/attribute_methods/serialization.rb
Expand Up @@ -98,16 +98,6 @@ def initialize_attributes(attributes, options = {})


attributes attributes
end end

private

def attribute_cast_code(attr_name)
if serialized_attributes.include?(attr_name)
"v.unserialized_value"
else
super
end
end
end end


def type_cast_attribute_for_write(column, value) def type_cast_attribute_for_write(column, value)
Expand Down
Expand Up @@ -34,21 +34,6 @@ def type


module ClassMethods module ClassMethods
protected 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. # 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. # 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) def define_method_attribute=(attr_name)
Expand Down

0 comments on commit 5fef8c1

Please sign in to comment.