Refactor clear_timestamp_attributes to use the newly created all_timestamp_attributes_in_model

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
This commit is contained in:
Franck Verrot
2011-01-25 23:36:08 +01:00
committed by Santiago Pastorino
parent a5b03e9c7a
commit 8dcacd0cc7

View File

@@ -1898,11 +1898,9 @@ MSG
# Clear attributes and changed_attributes
def clear_timestamp_attributes
%w(created_at created_on updated_at updated_on).each do |attribute_name|
if has_attribute?(attribute_name)
self[attribute_name] = nil
changed_attributes.delete(attribute_name)
end
all_timestamp_attributes_in_model.each do |attribute_name|
self[attribute_name] = nil
changed_attributes.delete(attribute_name)
end
end
end