Replace calls to #with_exclusive_scope

Rails 4 deprecates this method
No need for assert_block here
Access AR#attributes using strings

In Rails 4 #attributes returns a regular hash rather with string keys
rather than a HashWithIndifferentAccess.
Ensure ordering is as outlined in test

This is required to override the default ordering that exists
on the DocumentCollection#editions association that the editions are
accessed through.
Worldwide orgs factory generates unique names
Handle different behaviour of AR and factory_girl

We cannot rely on the ordering to be correctly set when passing in an
array of attachments to the factory method
Remove #readonly override from join models

Rails 4 changes the behaviour of ActiveRecord such that a model that
is marked as "readonly" can no longer be destroyed (see
https://github.com/iGEL/rails/commit/a8b370f5c2fed87001e363d18ce60a47c1748885).
This prevents EditionRelations and ClassificationRelations from being
destroyed. Looking back through the git history, it looks like this
was originally put in as a way to prevent these join models from being
modified once they were created. I can't think of any good reason why
we should be enforcing this at the model level so I'm simply removing
the readonly designation from the model.
Don't rely on transient behaviour of factories/AR

Instead, the test should replicate the way that groups are created on
collections in real-world app usage.
No more need for distinct option on count