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