From 4ac4281c8b7f8c7be43bfa2f4141000f3ba16998 Mon Sep 17 00:00:00 2001 From: Adam Meehan Date: Sun, 7 Jun 2009 08:28:20 +1000 Subject: [PATCH] rename named local var --- .../active_record/attribute_methods.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/validates_timeliness/active_record/attribute_methods.rb b/lib/validates_timeliness/active_record/attribute_methods.rb index 7a2f66d..30b4689 100644 --- a/lib/validates_timeliness/active_record/attribute_methods.rb +++ b/lib/validates_timeliness/active_record/attribute_methods.rb @@ -25,14 +25,14 @@ module ValidatesTimeliness def write_date_time_attribute(attr_name, value, type, time_zone_aware) @attributes_cache["_#{attr_name}_before_type_cast"] = value - new = ValidatesTimeliness::Parser.parse(value, type) + value = ValidatesTimeliness::Parser.parse(value, type) - if new && type != :date - new = new.to_time - new = new.in_time_zone if time_zone_aware + if value && type != :date + value = value.to_time + value = value.in_time_zone if time_zone_aware end - write_attribute(attr_name.to_sym, new) + write_attribute(attr_name.to_sym, value) end def read_attribute_before_type_cast_with_timeliness(attr_name)