diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-02-08 15:27:43 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-02-08 15:27:43 -0800 |
commit | f86b19842620301b969a4a264c97e5e6ebc7b67f (patch) | |
tree | 01c0f9f1ee9c075b88ba8ef8fd697cb99e0adbd0 /activerecord/lib/active_record/attributes/translator.rb | |
parent | 857bd732723a6ca297195198b9796ba79226f83f (diff) | |
download | rails-f86b19842620301b969a4a264c97e5e6ebc7b67f.tar.gz rails-f86b19842620301b969a4a264c97e5e6ebc7b67f.tar.bz2 rails-f86b19842620301b969a4a264c97e5e6ebc7b67f.zip |
removed unnecessary translator object
Diffstat (limited to 'activerecord/lib/active_record/attributes/translator.rb')
-rw-r--r-- | activerecord/lib/active_record/attributes/translator.rb | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/activerecord/lib/active_record/attributes/translator.rb b/activerecord/lib/active_record/attributes/translator.rb deleted file mode 100644 index 62fb874215..0000000000 --- a/activerecord/lib/active_record/attributes/translator.rb +++ /dev/null @@ -1,28 +0,0 @@ -module ActiveRecord - module Attributes - class Translator # :nodoc: - def initialize(attributes, column_types) - @attributes = attributes - @column_types = column_types - end - - def cast_attribute(attr_name, method) - v = @attributes.fetch(attr_name) { yield } - v && send(method, attr_name, v) - end - - def cast_serialized(attr_name, value) - value.unserialized_value - end - - def cast_tz_conversion(attr_name, value) - value = cast_column(attr_name, value) - value.acts_like?(:time) ? value.in_time_zone : value - end - - def cast_column(attr_name, value) - @column_types[attr_name].type_cast value - end - end - end -end |