<p>Yes I just checked and counter caches don't seem to have any way to specify extra conditions - they just count the number of records of one type that are associated with a record of a different type.</p>
<p>So there is no way to limit it to visible records only.</p>
<p>There are a few third party gems that can do it.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/issues/2274?email_source=notifications&email_token=AAK2OLOFKCTRYEIP34HSFMTP323D5A5CNFSM4H2XX6WKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYKTNSI#issuecomment-504706761">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLOHQLLAPPMRTTNQ3SLP323D5ANCNFSM4H2XX6WA">mute the thread</a>.<img src="https://github.com/notifications/beacon/AAK2OLNVUOMPD24QHRMWF2TP323D5A5CNFSM4H2XX6WKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYKTNSI.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/issues/2274?email_source=notifications\u0026email_token=AAK2OLOFKCTRYEIP34HSFMTP323D5A5CNFSM4H2XX6WKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYKTNSI#issuecomment-504706761",
"url": "https://github.com/openstreetmap/openstreetmap-website/issues/2274?email_source=notifications\u0026email_token=AAK2OLOFKCTRYEIP34HSFMTP323D5A5CNFSM4H2XX6WKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYKTNSI#issuecomment-504706761",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>