Skip to content

Instantly share code, notes, and snippets.

@mperham
Created July 12, 2013 17:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mperham/5986104 to your computer and use it in GitHub Desktop.
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!
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