Browse files

add around_create callback documentation for ActiveModel::Callbacks

  • Loading branch information...
1 parent 694c227 commit d7f0e434ddae4b5d7505486b75eabc123b746d4a @spaghetticode spaghetticode committed Aug 8, 2012
Showing with 11 additions and 0 deletions.
  1. +11 −0 activemodel/lib/active_model/callbacks.rb
View
11 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.
#

0 comments on commit d7f0e43

Please sign in to comment.