mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
add around_create callback documentation for ActiveModel::Callbacks
This commit is contained in:
parent
694c227314
commit
d7f0e434dd
1 changed files with 11 additions and 0 deletions
|
@ -38,6 +38,17 @@ module ActiveModel
|
||||||
# # Your code here
|
# # Your code here
|
||||||
# end
|
# end
|
||||||
#
|
#
|
||||||
|
# When defining an around callback remember to yield to the block, otherwise
|
||||||
|
# it won't be executed:
|
||||||
|
#
|
||||||
|
# around_create :log_status
|
||||||
|
#
|
||||||
|
# def log_status
|
||||||
|
# puts 'going to call the block...'
|
||||||
|
# yield
|
||||||
|
# puts 'block successfully called.'
|
||||||
|
# end
|
||||||
|
#
|
||||||
# You can choose not to have all three callbacks by passing a hash to the
|
# You can choose not to have all three callbacks by passing a hash to the
|
||||||
# +define_model_callbacks+ method.
|
# +define_model_callbacks+ method.
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in a new issue