Start working on JoinDependency hacks for Rails 4.1

Conflicts:
	lib/ransack/adapters/active_record/3.1/context.rb
Inspect object on error message for klassify
joins no longer receives a JoinAssociation object

Plus construct the associations on the already created join_dependency
instance rather than creating a new JoinBase for every association
needed
Pass a JoinDependency to object.joins

Help to give a more accurate query. The nodes for the condition itself
however are not being built properly.

Example of a desired query:

        "comments\".\"body\" LIKE '%e%' OR \"comments_articles\".\"body\" LIKE '%e%'

What we currently get:

        "comments\".\"body\" LIKE '%e%' OR \"comments\".\"body\" LIKE '%e%'

Query related to current failing spec:

        => "SELECT \"people\".* FROM \"people\" LEFT OUTER JOIN \"comments\" ON \"comments\".\"person_id\" = \"people\".\"id\" LEFT OUTER JOIN \"articles\" ON \"articles\".\"person_id\" = \"people\".\"id\" LEFT OUTER JOIN \"comments\" \"comments_articles\" ON \"comments_articles\".\"article_id\" = \"articles\".\"id\" WHERE ((\"comments\".\"body\" LIKE '%e%' OR \"comments_articles\".\"body\" LIKE '%e%'))  ORDER BY id DESC"

Also had to do some tweaking in rails JoinDependency#join_constraints to
build the nested query joins properly
Build arel nodes properly for associations found on the fly

By constructing the table aliases again from the main join_dependency
object which can keep track of all joins
Build a association hash to keep track of their parents

Avoid building same associations twice, there was a time we could check
the parent in the JoinAssociation but theres no longer a parent accessor
there

first green build \o/\o/\o/\o\o/
Merge pull request #324 from huoxito/rails-upgrade

Internal changes for Rails v4.1.0 compatibility