@tomhughes commented on this pull request.

I'm a little reluctant to start adding Terra Draw until we've done the 
conversion of the front page and decided how we're going to handle drawing 
there - quite possibly Terra Draw is the answer but I want to be sure we don't 
wind up with two solutions to the same problem.

Also there's a commit early on that adds a blank line to the end of `en.yml` 
that gets removed again late.

> +  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|

Instead of creating a duplicate record and changing it then throwing it away, 
could we not just assign the new attributes, then use `_was` methods from 
`ActiveModel::Dirty` to do checks, and then save the changed record?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/7148#pullrequestreview-4470354136
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