Method: CouchRest::Mixins::Callbacks::ClassMethods#skip_callback

Defined in:
lib/couchrest/mixins/callbacks.rb

#skip_callback(name, *filters, &block) ⇒ Object



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
# File 'lib/couchrest/mixins/callbacks.rb', line 481

def skip_callback(name, *filters, &block)
  _update_callbacks(name, filters, block) do |callbacks, type, filters, options|
    filters.each do |filter|
      callbacks = send("_#{name}_callback=", callbacks.clone(self))

      filter = callbacks.find {|c| c.matches?(type, filter) }

      if filter && options.any?
        filter.recompile!(options, options[:per_key] || {})
      else
        callbacks.delete(filter)
      end
    end
  end
end