aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorkennyj <kennyj@gmail.com>2012-09-28 00:09:21 +0900
committerkennyj <kennyj@gmail.com>2012-09-28 00:09:21 +0900
commit5fef8c174ad45fd1a381975816debf8446d09db0 (patch)
tree2ee96da1ca6b06ae94c77a2c647d347f52ff72de /activerecord
parent1b73dbd36fc5bd2d8ae015a16b2376250ab19b4e (diff)
downloadrails-5fef8c174ad45fd1a381975816debf8446d09db0.tar.gz
rails-5fef8c174ad45fd1a381975816debf8446d09db0.tar.bz2
rails-5fef8c174ad45fd1a381975816debf8446d09db0.zip
Removing dead code. attribute_cast_code is not called.
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/attribute_methods/serialization.rb10
-rw-r--r--activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb15
2 files changed, 0 insertions, 25 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/serialization.rb b/activerecord/lib/active_record/attribute_methods/serialization.rb
index bdda5bc009..6395f92b4b 100644
--- a/activerecord/lib/active_record/attribute_methods/serialization.rb
+++ b/activerecord/lib/active_record/attribute_methods/serialization.rb
@@ -98,16 +98,6 @@ module ActiveRecord
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)
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 9647d03be4..b9a69cdb0a 100644
--- a/activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
+++ b/activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
@@ -34,21 +34,6 @@ module ActiveRecord
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)