Created
March 5, 2012 02:37
-
-
Save jbarnette/1976133 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ActiveRecord::Base | |
attr_accessible nil | |
def update_attributes *args | |
raise "Don't call #{self.class.name}#update_attributes. " + | |
"Mass assignment is pure evil." | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can you clarify why
update_attributes
is bad? The Rails Security Guide states:Given that, I fail to see why disabling
update_attributes
is necessary.