#897: Add compatibility with Rails 4 associations

Depending of the rails version it will either use previous options[:conditions] in rails 3 or use reflection.scope in rails 4