Skip to content

Commit 991cf78

Browse files
committed
Merge pull request rails#7768 from kennyj/removing_dead_code_20120928
Removing dead code. attribute_cast_code isn't called.
2 parents 1b73dbd + 5fef8c1 commit 991cf78

File tree

2 files changed

+0
-25
lines changed

2 files changed

+0
-25
lines changed

activerecord/lib/active_record/attribute_methods/serialization.rb

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -98,16 +98,6 @@ def initialize_attributes(attributes, options = {})
9898

9999
attributes
100100
end
101-
102-
private
103-
104-
def attribute_cast_code(attr_name)
105-
if serialized_attributes.include?(attr_name)
106-
"v.unserialized_value"
107-
else
108-
super
109-
end
110-
end
111101
end
112102

113103
def type_cast_attribute_for_write(column, value)

activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,6 @@ def type
3434

3535
module ClassMethods
3636
protected
37-
# The enhanced read method automatically converts the UTC time stored in the database to the time
38-
# zone stored in Time.zone.
39-
def attribute_cast_code(attr_name)
40-
column = columns_hash[attr_name]
41-
42-
if create_time_zone_conversion_attribute?(attr_name, column)
43-
typecast = "v = #{super}"
44-
time_zone_conversion = "v.acts_like?(:time) ? v.in_time_zone : v"
45-
46-
"((#{typecast}) && (#{time_zone_conversion}))"
47-
else
48-
super
49-
end
50-
end
51-
5237
# Defined for all +datetime+ and +timestamp+ attributes when +time_zone_aware_attributes+ are enabled.
5338
# This enhanced write method will automatically convert the time passed to it to the zone stored in Time.zone.
5439
def define_method_attribute=(attr_name)

0 commit comments

Comments
 (0)