diff options
author | Ryan Bigg <radarlistener@gmail.com> | 2009-07-16 07:48:54 +1000 |
---|---|---|
committer | Ryan Bigg <radarlistener@gmail.com> | 2009-07-16 07:48:54 +1000 |
commit | bb8fb2d143dad0e4334ac9c83f5c03b1eb5473c8 (patch) | |
tree | b420025d98a5a152cd62674a15b5763956089406 | |
parent | 65ab56bb188350c8d15931072939b8b6b7bdff63 (diff) | |
download | rails-bb8fb2d143dad0e4334ac9c83f5c03b1eb5473c8.tar.gz rails-bb8fb2d143dad0e4334ac9c83f5c03b1eb5473c8.tar.bz2 rails-bb8fb2d143dad0e4334ac9c83f5c03b1eb5473c8.zip |
Document that after_create can take a block.
-rw-r--r-- | activerecord/lib/active_record/callbacks.rb | 4 |
1 files changed, 4 insertions, 0 deletions
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_ <tt>Base.save</tt> 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 |