mongoid/mongoid — pull request #3691 by walkeriniraq (2014-06-15 19:09:37+00:00)
Title: Update to AM where deep_munge can be disabled

Short version: Rails past 4.1 allows deep_munge to be disabled.

Long version:
Rails in version 4.0 (and latest of the 3.X series) added deep_munge as the default for parsing the params hash, which removes [nil] and empty arrays from the params, in order to fix a vulnerability in ActiveRecord. https://github.com/imanel/rails/commit/060c91cd59ab86583a8f2f52142960d3433f62f5

This turns out to have some surprising side effects such as https://github.com/rails/strong_parameters/issues/192 - and is not needed for a library like Mongoid which doesn't have that vulnerability.

Rails 4.1 added the ability to disable deep_munge in the config. https://github.com/rails/rails/pull/13188 - which allows not having to write workaround code for saving an empty array (for example).

Background can be found here: https://github.com/rails/rails/issues/13420