Start working on JoinDependency hacks for Rails 4.1

Hey guys, I'm trying to understand and reading through activerecord internals one more time (every time I did it before I lost it) hoping to help on the ransack upgrade to rails 4.1.0.

These changes should help ransack/adapter/active_record/base_spec.rb back to green again (I got one failing spec on that file yet though and down to 17 failures on the whole build). I'm aware of the issue in polyamorous gem I'm running the specs pointing that gem to my local path. Once I have a better idea of what I'm doing I'll try to submit a PR there as well.