Skip to content

Instantly share code, notes, and snippets.


Igor Escobar igorescobar

Block or report user

Report or block igorescobar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
justinko / callback_disabler.rb
Created Sep 2, 2011
Disable raw filter callbacks in RSpec
View callback_disabler.rb
# In spec/support/callback_disabler.rb
module CallbackDisabler
def self.store_callbacks(model, filters)
model = constantize(model)
filters.each do |filter|
model.send("_#{filter}_callbacks").each do |callback|
stored_callbacks[model] << {
filter: filter, kind: callback.kind, raw_filter: callback.raw_filter
You can’t perform that action at this time.