@pablobm commented on this pull request.


> +  end
+
+  def check_revocation(original, changes)
+    original.revoker = current_user if original.active? && 
!projected_record(original, changes).active?
+  end
+
+  def updating_without_revoking?(original, changes)
+    original.active? && projected_record(original, changes).active?
+  end
+
+  def reactivating?(original, changes)
+    !original.active? && projected_record(original, changes).active?
+  end
+
+  def projected_record(original, changes)
+    original.dup.tap do |duplicate|

That crossed my mind, but the checks use `active?` which is a method and won't 
be present in the dirty. Instead we'd have to call `ends_at_was?` explicitly 
which I'm not comfortable with.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/7148#discussion_r3391469952
You are receiving this because you are subscribed to this thread.

Message ID: 
<openstreetmap/openstreetmap-website/pull/7148/review/[email protected]>
_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to