Fall back to type casting from the connection adapter

There are several valid cases where right now we can't determine the
association's class in a call to `where`. In these cases, we can fall
back to casting by looking up the column from the connection adapter
(which is what happens right now when we fall through to Arel)

This is ugly, and since we're trying to separate the concept of a type
from a column, I'd like to remove it in the future. The problem
basically comes down to this:

    Liquid.joins(molecules: :electrons)
      .where("molecules.name" => "something", "electrons.name" => "something")

The hash in this case will turn into:

    {
      molecules: { name: "something" },
      electrons: { name: "something" },
    }

What we actually need is:

    {
      molecules: {
        name: "something",
        electrons: { name: "something" },
      }
    }

/cc @mrgilman