mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-25 15:22:58 +00:00
fixed dirty attributes when old value incorrectly read and added more examples for dirty attributes
This commit is contained in:
@@ -71,8 +71,7 @@ module ValidatesTimeliness
|
||||
def write_date_time_attribute(attr_name, value)
|
||||
attr_name = attr_name.to_s
|
||||
column = column_for_attribute(attr_name)
|
||||
|
||||
old = read_attribute('#{attr_name}') if defined?(ActiveRecord::Dirty)
|
||||
old = read_attribute(attr_name) if defined?(ActiveRecord::Dirty)
|
||||
new = self.class.parse_date_time(value, column.type)
|
||||
|
||||
if self.class.send(:create_time_zone_conversion_attribute?, attr_name, column)
|
||||
|
||||
Reference in New Issue
Block a user