Skip to content

Instantly share code, notes, and snippets.

@jaigouk
Forked from benedikt/gist:1977438
Created April 14, 2012 05:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaigouk/2382288 to your computer and use it in GitHub Desktop.
Save jaigouk/2382288 to your computer and use it in GitHub Desktop.
Protect all fields against mass assignment in a mongoid document by default
module Mongoid
module MassAssignmentSecurity
extend ActiveSupport::Concern
included do
attr_accessible nil
end
end
module Document
include MassAssignmentSecurity
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment