rails/rails — pull request #14592 by laurocaetano (2014-04-04 01:22:09+00:00)
Title: The comparison between `Relation` and `CollectionProxy` should be consistent.

Before this patch, it was behaving this way:

```ruby
author.posts == Post.where(author_id: author.id)
# => true
Post.where(author_id: author.id) == author.posts
# => false
```

This patch checks if the object given to `Relation#==` is a `CollectionProxy` and then call `to_a` on it to do the comparison.

Fixes #13506