title: Rails scope where account has user
body: <p>I have an account and a user model where an account has_one user. So in my user table I have the account_id.</p>
  
  <p>I want to create a scope for my accounts where I can pass has_user = TUE/FALSE and it returns the accounts with/without user.</p>
  
  <pre><code>scope :has_user, -&gt; (has_user) { where(...) }
  </code></pre>
  
  <p>Can anybody help how to write this scope?</p>