Custom JoinAssociation class for Rails 4.1.
Rails 4.1 has an add_reflection method.

The reflections hash is computed afresh on each call, so we can't modify it. Hence, use the add_reflection method if it exists.
Rails 4.1 does not escape table names for join tables by default.
Use custom join association class where possible.

Essentially, this behaviour only has an impact with Rails 4.1 onwards. We don't need to build a custom scope, but instead can use our join association class instead.

Yes, scopes came in with Rails 4.0, but there's other differences in behaviour that makes removing the scope for 4.0 a pain in the neck.
Updating Polymorpher spec for ActiveRecord's new add_reflection.