Rails 4.1 compatibility

Rails 4.1 removes the `HasAndBelongsToMany` preloader, to the changes in c91640a don't work anymore. @osheroff would you take a look at it, please?

cc @grosser @pschambacher 
maybe put into a method so the logic can be shared