Skip to content

Instantly share code, notes, and snippets.

@gcirne
Created March 14, 2012 02:23
Show Gist options
  • Save gcirne/2033503 to your computer and use it in GitHub Desktop.
Save gcirne/2033503 to your computer and use it in GitHub Desktop.
Disable Mass Assignment for Mongoid
# config/initializers/disable_mass_assignment.rb
module Mongoid::Document
self.included do |base|
base.send(:attr_accessible, nil)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment