diff options
author | andrea longhi <andrea@spaghetticode.it> | 2012-08-08 00:16:28 +0200 |
---|---|---|
committer | andrea longhi <andrea@spaghetticode.it> | 2012-08-08 00:16:28 +0200 |
commit | d7f0e434ddae4b5d7505486b75eabc123b746d4a (patch) | |
tree | 6f15b16a8f8b9432e283b975db3d56408c60a30b /activemodel/lib/active_model | |
parent | 694c227314e60c57bcad3f78a61df6cbc46ce1c7 (diff) | |
download | rails-d7f0e434ddae4b5d7505486b75eabc123b746d4a.tar.gz rails-d7f0e434ddae4b5d7505486b75eabc123b746d4a.tar.bz2 rails-d7f0e434ddae4b5d7505486b75eabc123b746d4a.zip |
add around_create callback documentation for ActiveModel::Callbacks
Diffstat (limited to 'activemodel/lib/active_model')
-rw-r--r-- | activemodel/lib/active_model/callbacks.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/activemodel/lib/active_model/callbacks.rb b/activemodel/lib/active_model/callbacks.rb index e669113001..e442455a53 100644 --- a/activemodel/lib/active_model/callbacks.rb +++ b/activemodel/lib/active_model/callbacks.rb @@ -38,6 +38,17 @@ module ActiveModel # # Your code here # 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 # +define_model_callbacks+ method. # |