Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix #6591. If a field with timezone isn't changed, we don't call will…

…_change!.
  • Loading branch information...
commit 510ef2be5396fb2cd8209b13e8b8ddac3f7e13a5 1 parent bebbdb5
@kennyj authored
View
3  activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
@@ -42,8 +42,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
Please sign in to comment.
Something went wrong with that request. Please try again.