From bb8fb2d143dad0e4334ac9c83f5c03b1eb5473c8 Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Thu, 16 Jul 2009 07:48:54 +1000 Subject: Document that after_create can take a block. --- activerecord/lib/active_record/callbacks.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/activerecord/lib/active_record/callbacks.rb b/activerecord/lib/active_record/callbacks.rb index 01e41c04df..97bb7f664d 100644 --- a/activerecord/lib/active_record/callbacks.rb +++ b/activerecord/lib/active_record/callbacks.rb @@ -262,6 +262,10 @@ module ActiveRecord # Is called _after_ Base.save on new objects that haven't been saved yet (no record exists). # Note that this callback is still wrapped in the transaction around +save+. For example, if you # invoke an external indexer at this point it won't see the changes in the database. + # + # class Contact < ActiveRecord::Base + # after_create { |record| logger.info( "Contact #{record.id} was created." ) } + # end def after_create() end def create_with_callbacks #:nodoc: return false if callback(:before_create) == false -- cgit v1.2.3