Skip to content

Commit

Permalink
Fix rails#6591. If a field with timezone isn't changed, we don't call…
Browse files Browse the repository at this point in the history
… will_change!.
  • Loading branch information
kennyj committed Jun 4, 2012
1 parent cfc7f60 commit 635032f
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -57,8 +57,9 @@ def #{attr_name}=(original_time)
time = time.is_a?(String) ? Time.zone.parse(time) : time.to_time rescue time
end
time = time.in_time_zone rescue nil if time
changed = read_attribute(:#{attr_name}) != time
write_attribute(:#{attr_name}, original_time)
#{attr_name}_will_change!
#{attr_name}_will_change! if changed
@attributes_cache["#{attr_name}"] = time
end
EOV
Expand Down

0 comments on commit 635032f

Please sign in to comment.