fixed bug with attribute cache not clearing on write for date and time columns

This commit is contained in:
Adam Meehan
2008-08-22 14:06:08 +10:00
parent cd9f4d2d54
commit b9f11a1f7b
3 changed files with 14 additions and 1 deletions

View File

@@ -146,7 +146,7 @@ module ValidatesTimeliness
def define_write_method_for_dates_and_times(attr_name, type)
method_body = <<-EOV
def #{attr_name}=(value)
@attributes_cache['#{attr_name}'] ||= self.class.parse_date_time(value, :#{type})
@attributes_cache['#{attr_name}'] = self.class.parse_date_time(value, :#{type})
@attributes['#{attr_name}'] = value
end
EOV