diff options
author | Akira Matsuda <ronnie@dio.jp> | 2011-02-07 08:29:06 +0900 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2011-02-07 09:51:51 -0200 |
commit | 40aefb93018277ee7cafc5529b16d7b6df8aa4dd (patch) | |
tree | 9f918509c468a7aff1822aae4fa39e3bfaa511d6 /activerecord/lib/active_record/attribute_methods | |
parent | 1fd9d978a737d36cf7cca698f0fcbfc6fcdbed98 (diff) | |
download | rails-40aefb93018277ee7cafc5529b16d7b6df8aa4dd.tar.gz rails-40aefb93018277ee7cafc5529b16d7b6df8aa4dd.tar.bz2 rails-40aefb93018277ee7cafc5529b16d7b6df8aa4dd.zip |
avoid nil.dup
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods')
-rw-r--r-- | activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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 a72eecb50e..76218d2a73 100644 --- a/activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb +++ b/activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb @@ -41,7 +41,7 @@ module ActiveRecord if create_time_zone_conversion_attribute?(attr_name, columns_hash[attr_name]) method_body, line = <<-EOV, __LINE__ + 1 def #{attr_name}=(original_time) - time = original_time.dup + time = original_time.dup unless original_time.nil? unless time.acts_like?(:time) time = time.is_a?(String) ? Time.zone.parse(time) : time.to_time rescue time end |