instance method
_define_before_model_callback
Ruby on Rails 7.1.6
Since v5.2.8.1 PrivateSignature
_define_before_model_callback(klass, callback)
No documentation comment.
Parameters
-
klassreq -
callbackreq
Source
# File activemodel/lib/active_model/callbacks.rb, line 129
def _define_before_model_callback(klass, callback)
klass.define_singleton_method("before_#{callback}") do |*args, **options, &block|
options.assert_valid_keys(:if, :unless, :prepend)
set_callback(:"#{callback}", :before, *args, options, &block)
end
end
Defined in activemodel/lib/active_model/callbacks.rb line 129
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveModel::Callbacks