Created
July 29, 2015 21:38
-
-
Save joshuaflanagan/f229efce40c2dfe9e7d0 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
def no_surprises! | |
ActiveRecord::Base.class_eval do | |
include SkipsValidations | |
include SkipsCallbacks | |
end | |
end | |
module SkipsValidations | |
def perform_validations(*) | |
true | |
end | |
end | |
module SkipsCallbacks | |
def run_callbacks(*) | |
yield if block_given? | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment