Skip to content

Instantly share code, notes, and snippets.

@jasoncodes
Created August 17, 2010 09:52
Show Gist options
  • Save jasoncodes/529125 to your computer and use it in GitHub Desktop.
Save jasoncodes/529125 to your computer and use it in GitHub Desktop.
Noisy protected attributes (mass-assignment security)
ActiveRecord::Base.send(:attr_accessible, nil)
module ActiveModel::MassAssignmentSecurity::Sanitizer
protected
def warn!(attrs)
raise "Can't mass-assign protected attributes: #{attrs.join(', ')}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment