fix read attribute bug for frozen record (reported by Les Nightingill)

This commit is contained in:
Adam Meehan
2009-04-06 13:52:07 +10:00
parent 88fce1d679
commit b197d537f1
2 changed files with 11 additions and 1 deletions

View File

@@ -76,7 +76,7 @@ module ValidatesTimeliness
time = self.class.parse_date_time(time, type)
else
time = read_attribute(attr_name)
@attributes[attr_name] = time && time_zone_aware ? time.in_time_zone : time
@attributes[attr_name] = (time && time_zone_aware ? time.in_time_zone : time) unless frozen?
end
@attributes_cache[attr_name] = time && time_zone_aware ? time.in_time_zone : time
end