Skip to content

Instantly share code, notes, and snippets.

@stevenbristol
Created April 8, 2009 05:07
Show Gist options
  • Save stevenbristol/91646 to your computer and use it in GitHub Desktop.
Save stevenbristol/91646 to your computer and use it in GitHub Desktop.
class ActiveRecord::Base
def log_protected_attribute_removal(*attributes)
s = "WARNING: Can't mass-assign these protected attributes: #{attributes.join(', ')}"
if Rails.env.development? || Rails.env.test?
raise s
else
logger.debug s
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment