instance method
reset_callbacks
Ruby on Rails 8.0.4
Since v3.0.20Signature
reset_callbacks(name)
Remove all set callbacks for the given event.
Parameters
-
namereq
Source
# File activesupport/lib/active_support/callbacks.rb, line 811
def reset_callbacks(name)
callbacks = get_callbacks name
self.descendants.each do |target|
chain = target.get_callbacks(name).dup
callbacks.each { |c| chain.delete(c) }
target.set_callbacks name, chain
end
set_callbacks(name, callbacks.dup.clear)
end
Defined in activesupport/lib/active_support/callbacks.rb line 811
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Callbacks::ClassMethods