instance method
reset_callbacks
Ruby on Rails 3.1.12
Since v3.0.20Signature
reset_callbacks(symbol)
Remove all set callbacks for the given event.
Parameters
-
symbolreq
Source
# File activesupport/lib/active_support/callbacks.rb, line 530
def reset_callbacks(symbol)
callbacks = send("_#{symbol}_callbacks")
ActiveSupport::DescendantsTracker.descendants(self).each do |target|
chain = target.send("_#{symbol}_callbacks").dup
callbacks.each { |c| chain.delete(c) }
target.send("_#{symbol}_callbacks=", chain)
target.__define_runner(symbol)
end
self.send("_#{symbol}_callbacks=", callbacks.dup.clear)
__define_runner(symbol)
end
Defined in activesupport/lib/active_support/callbacks.rb line 530
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Callbacks::ClassMethods