alphagov/govuk_need_api — pull request #8 by fatbusinessman (2013-10-25 09:07:31+00:00)
Title: Assign a need ID when creating, not validating

Assigning a need ID in the post-validation hook means we can't validate
needs in bulk (for instance, during a batch import), as it'll then
assign the same ID to them all and fail when it tries to create them.

The order of the callbacks is now important, as otherwise Mongoid will
assign a new ID from its own callback before the callback fires to find
the next available need ID.