diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2012-05-08 23:56:25 +0530 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2012-05-08 23:56:25 +0530 |
commit | 7918d7bf5c6f0ce53e648c793f6034d6216a4808 (patch) | |
tree | febc17be0b2768394b67a14fa7dee842d3bde3b6 /activemodel/README.rdoc | |
parent | 882e750cbe09450388190e92e2d92eac352b40fa (diff) | |
parent | 7e26f7f0f7e3c230c333e1b265727a9b8cf7c91f (diff) | |
download | rails-7918d7bf5c6f0ce53e648c793f6034d6216a4808.tar.gz rails-7918d7bf5c6f0ce53e648c793f6034d6216a4808.tar.bz2 rails-7918d7bf5c6f0ce53e648c793f6034d6216a4808.zip |
Merge branch 'master' of github.com:lifo/docrails
Diffstat (limited to 'activemodel/README.rdoc')
-rw-r--r-- | activemodel/README.rdoc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activemodel/README.rdoc b/activemodel/README.rdoc index 1fd75141f8..0c7089598c 100644 --- a/activemodel/README.rdoc +++ b/activemodel/README.rdoc @@ -135,6 +135,16 @@ behavior out of the box: pattern in a Rails App and take advantage of all the standard observer functions. + class PersonObserver < ActiveModel::Observer + def after_create(person) + person.logger.info("New person added!") + end + + def after_destroy(person) + person.logger.warn("Person with an id of #{person.id} was destroyed!") + end + end + {Learn more}[link:classes/ActiveModel/Observer.html] * Making objects serializable |