Extend association support in PredicateBuilder AR:B.where to include has_one and has_many

**Description:**

Support for association names in `where` queries previously worked for `belongs_to` associations, but not for `has_one` or `has_many` associations. The SQL generated for `has_one`/`has_many` queries would actually be very confusingly wrong, using the wrong table and column entirely.

Given:

    class Author < ActiveRecord::Base
      has_many :posts
      has_one :post
    end

Existing ActiveRecord on master supports the behavior as follows (has_one is not well supported in current master, so an example is not included)

    authors_of_published_posts = Author.where(posts: { id: Post.where(published: true) }).joins(:posts)

This pull request adds support for this style of where conditions, thus filling out the support for association names in queries.

    Author.where(posts: Post.where(published: true)).joins(:posts)
    Author.where(post: Post.where(published: true)).joins(:posts)

**Why we need this:**

ActiveRecord currently supports calling `where()` with hash arguments of the form `where(belongs_to_association: <#ActiveRecord::Base ...>)`. This completes that features by generating the correct queries when `has_*` associations are used.

Currently we treat all `has_*` associations as `belongs_to` associations in the query and put the wrong foreign key into the query based on this incorrect assumption.

Adding support for these association keys is straight forward. Every key in the conditions hash already gets `reflect_on_association` called on it. This patch just takes the correct steps for `has_*` associations instead of inserting bad SQL into the query based on a valid assumption by the programmer.