Skip to content

Instantly share code, notes, and snippets.

@joshuaflanagan
Created July 29, 2015 21:38
Show Gist options
  • Save joshuaflanagan/f229efce40c2dfe9e7d0 to your computer and use it in GitHub Desktop.
Save joshuaflanagan/f229efce40c2dfe9e7d0 to your computer and use it in GitHub Desktop.
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