Created
October 19, 2012 20:11
-
-
Save bloudermilk/3920398 to your computer and use it in GitHub Desktop.
Allow mass-assignment of type attribute in Rails
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 MyModel < ActiveRecord::Base | |
private | |
# Allow mass-assignment of the type attribute | |
def self.attributes_protected_by_default | |
super - %W[ type ] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment