title: How to query records that have an ActiveStorage attachment?
body: <p>Given a model with ActiveStorage </p>
  
  <pre><code>class User 
    has_one_attached :avatar
  end
  </code></pre>
  
  <p>I can check whether a single user has an avatar</p>
  
  <pre><code>@user.avatar.attached? 
  </code></pre>
  
  <p>But how can I return a collection of all users with (or all users without) an attachment?</p>
  
  <p>I tried using <code>joins</code> to return all Users with an attachment, but this does not seem to work on either the blob or attachment table, or perhaps I'm not getting the syntax correct. </p>
  
  <p>I'm sure I am overlooking something obvious. Is it possible to do something along the lines of:</p>
  
  <pre><code>User.where(attached_avatar: nil)
  </code></pre>
  
  <p>And if so, where is this documented?</p>