Created
July 12, 2013 17:15
-
-
Save mperham/5986104 to your computer and use it in GitHub Desktop.
Have 100s of models and thousands of tests? Prefer simplicity over security when upgrading to Rails4? YOLO!
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 | |
class << self | |
def inherited_yolo(klass) | |
old_inherited(klass) | |
klass.attr_accessible(*klass.column_names.map(&:to_sym)) unless klass.abstract_class? | |
end | |
alias_method :old_inherited, :inherited | |
alias_method :inherited, :inherited_yolo | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment