This should use the count through association:
```ruby
addresses.includes(:address_type).where(address_types: { name: 'Visiting' }).count > 0
```
even better you could add the scope Address.visiting to the address model