Fixed compatibility with Mongoid 4.x, which removed attr_accessible of protected attributes.

See https://github.com/mongoid/mongoid/issues/3664 and https://github.com/mongoid/mongoid/issues/3663.