It might be nice to merge up the `agent` or `owner` check into the SQL query. Something like this could work:

```ruby
memberships.where(account_id: account_id, role: ['agent', 'owner']).exists?
```