alphagov/content-store — pull request #38 by alext (2014-08-01 09:32:10+00:00)
Title: Gracefully handle unexpected fields in the input.

Mongoid has changed how it handles unknown fields in an `update_attributes` call. With Mongoid3 it silently persists the extra fields. With Mongoid4 it raises an error (unless explicitly configured to adopt the Mongoid3 behaviour). This is a good thing IMO, but it has introduced a regression here.

As it stands extra fields in the intput are causing a 500 error. This changes this so that they now return a 422.