lib/superstore/timestamps.rb in superstore-1.0.10 vs lib/superstore/timestamps.rb in superstore-1.0.11
- old
+ new
@@ -10,10 +10,10 @@
self.created_at ||= Time.current
self.updated_at ||= Time.current
end
before_update if: :changed? do
- self.updated_at = Time.current
+ self.updated_at = Time.current unless self.changed_attributes.key?("updated_at")
end
end
end
end