mongoid/mongoid — pull request #3901 by maurogeorge (2014-12-30 16:44:04+00:00)
Title: Create the dependent behaviour restrict_with_error

Causes an error to be added to the owner if there are any associated
objects.

It is the same behaviour we have on [AR](http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html#method-i-has_many).