From d7f0e434ddae4b5d7505486b75eabc123b746d4a Mon Sep 17 00:00:00 2001 From: andrea longhi Date: Wed, 8 Aug 2012 00:16:28 +0200 Subject: add around_create callback documentation for ActiveModel::Callbacks --- activemodel/lib/active_model/callbacks.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'activemodel') 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. # -- cgit v1.2.3