ernie/meta_where — Issue #42: AREL merge (&) causes redundant joins
Author: nikhilgupte
Created: 2011-12-02 19:05:55+00:00
State: open

Without meta_where:

```ruby
> (UserVote.joins(:user) & User.verified).to_sql
=> "SELECT `votes`.* FROM `votes` INNER JOIN `users` ON `users`.`id` = `votes`.`user_id` WHERE `votes`.`type` = 'UserVote' AND (verified_at is not null)"
```

With meta_where:

```ruby
> (UserVote.joins(:user) & User.verified).to_sql
=> "SELECT `votes`.* FROM `votes` INNER JOIN `users` ON `users`.`id` = `votes`.`user_id` INNER JOIN `users` `voting_users_votes` ON `voting_users_votes`.`id` = `votes`.`user_id` WHERE `votes`.`type` = 'UserVote' AND (verified_at is not null)"
```