Skip to content

Instantly share code, notes, and snippets.

@olkeene
Created April 4, 2009 03:02
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 olkeene/90090 to your computer and use it in GitHub Desktop.
Save olkeene/90090 to your computer and use it in GitHub Desktop.
mass-assign errors display for dev env
if Rails.env.development?
ActiveRecord::Base.class_eval do
def log_protected_attribute_removal(*attributes)
raise "Can't mass-assign these protected attributes: #{attributes.join(', ')}"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment