<p></p>
<p><b>@grekko</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4284#discussion_r1354648597">app/models/user_mute.rb</a>:</p>
<pre style='color:#555'>> +  belongs_to :appointee, :class_name => "User"
+
+  validates :appointee, :uniqueness => { :scope => :creator_id }
+
+  def self.for_message?(message)
+    sender = message.sender
+
+    !sender.administrator? &&
+      !sender.moderator? &&
+      active_for?(
+        :current_user => message.recipient,
+        :other_user => sender
+      )
+  end
+
+  def self.active_for?(current_user:, other_user:)
</pre>
<blockquote>
<p dir="auto">Of course once you do that the question becomes is this method even needed when it's just forwarding the arguments to exists??</p>
</blockquote>
<p dir="auto">good point. Initially there were more places from which <code class="notranslate">UserMute.active_for?</code> in which the the terms <code class="notranslate">current_user</code> and <code class="notranslate">other_user</code> are used to reference the instances. So I thought it was making the code a bit easier to read/grasp from that context.</p>
<p dir="auto">Now there is just a single call, plus the call from <code class="notranslate">UserMute#for_message?</code> – I think it's ok to drop <code class="notranslate">UserMute#active_for?</code> and just call <code class="notranslate">UserMute#exists?</code> directly 👌🏽</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4284#discussion_r1354648597">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLLFFIACEBXKK5BBXG3X6ZY2TANCNFSM6AAAAAA53SDORY">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLOEIMMONZZXRREMNYTX6ZY2TA5CNFSM6AAAAAA53SDOR2WGG33NNVSW45C7OR4XAZNRKB2WY3CSMVYXKZLTORJGK5TJMV32UY3PNVWWK3TUL5UWJTTDSU6W2.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/4284/review/1670724973</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/4284#discussion_r1354648597",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/4284#discussion_r1354648597",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>