Refer to this app consistently.

We haven't had a consistent naming convention so far, so several
versions have cropped up:

  * Content Store
  * the content store
  * content-store
  * the content-store

I've rejected the two hyphenated versions in the name of plain English.
The choice of "the content store" over "Content Store" is
semi-arbitrary: I think it reflects how we tend to refer to this app,
but that may well reflect confirmation bias on my part.
Slience output when creating mongoid test indexes.
Bump bunny gem to 1.5.0

This allows us to specify mutliple rabbitmq hosts which will help with
robustness if one goes down.
Merge pull request #60 from alphagov/bump_bunny

Bump bunny gem to 1.5.0
Merge pull request #59 from alphagov/silence_test_index_creation

Slience output when creating mongoid test indexes.
Merge pull request #57 from alphagov/consistent-naming

Refer to this app consistently
Change the documentation around link types.

The previous documentation said that the keys represented the type of
the linked item (`organisations` or `topics`, for example); it's more
accurate to say that it's the type of the relationship itself.

For example, the `related` link type doesn't care about the type of the
thing it's linking to. As anotehr example, we could feasibly add `next`
or `previous` links for a series of items (multi-part guides, say), or
`up` links to a parent section.
Merge pull request #62 from alphagov/fix-link-type-documentation

Change the documentation around link types
Fix queue:watcher task to ack messages.

Setting `:ack => true` indicates that messages will be manually acked
(which is a little non-obvious.  This option has been renamed to
`:manual_ack` in newer versions of bunny.)

The default is to auto ack messages, which is what we want in this
instance.
Merge pull request #64 from alphagov/fix_queue_watcher

Fix queue:watcher task to ack messages.
Warn against using order to determine primacy.

We haven't been explicit that, while the content store preserves
ordering, we shouldn't be using that to express different kinds of
relationships, such as primary sections.
Be explicit about single-item relationships.

For example, a `primary_section` relationship might only make sense with
a single linked item, but for the sake of consistency of representation,
we're sticking with a list of 1 item.

If someone were to implement this incorrectly, this would get caught and
rejected by the model logic anyway, but since people have asked about
this behaviour before, it's worth adding it to the documentation so we
can cite it.
Split up a large paragraph.
Merge pull request #65 from alphagov/primacy

Warn against using order to determine primacy
Refactor QueuePublisher rabbitmq connections

Also improve unit tests around this, including some placeholders for
error handling
Add specs for publisher confirm nack case

This also fixes a bug in the message details passed to airbrake.  It was
referencing the non-existent `hash` variable, which is also a method on
Object[1], resulting in an abritrary number being sent to Errbit.

[1] http://apidock.com/ruby/Object/hash
Reset rabbitmq channel on errors.

The publisher confirm feature we're using allow sending one or more
messages to rabbitmq, and then requesting confirms for all of them.
This requires Bunny to keep track of how many confirms are outstanding.
If an error occurs when sending a message, this count can get out of
sync with the server, resulting in Bunny attempting to wait for more
confirms than will ever be sent, which in turn leads to timeout errors.

The outstanding message count is a per-channel thing, so by closing the
channel, and creating a new one, this problem is avoided, and subsequent
message sending works.
Merge pull request #66 from alphagov/handle_rabbitmq_restarts

Reset rabbitmq channel on errors.
Add stats-ruby gem

So that we can push stats to statsd.
Track timings for MongoDB queries we make

Add some tracking around MongoDB query duration so that we can better
understand which queries are slower than others.

Created a top-level Rails::Application `statsd` object for the
application to share.