diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2011-10-05 18:40:45 +0530 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2011-10-05 18:40:45 +0530 |
commit | ea49935a6e0eca8783bc8d1bb46a6c518c073cac (patch) | |
tree | 19df9888950304b223e2a680adb045d9d7a1618f /railties/guides/source/active_record_validations_callbacks.textile | |
parent | 34ed93931dcf688bc4f0f8f5649a44f2f1118a6a (diff) | |
download | rails-ea49935a6e0eca8783bc8d1bb46a6c518c073cac.tar.gz rails-ea49935a6e0eca8783bc8d1bb46a6c518c073cac.tar.bz2 rails-ea49935a6e0eca8783bc8d1bb46a6c518c073cac.zip |
copy editing
Diffstat (limited to 'railties/guides/source/active_record_validations_callbacks.textile')
-rw-r--r-- | railties/guides/source/active_record_validations_callbacks.textile | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/railties/guides/source/active_record_validations_callbacks.textile b/railties/guides/source/active_record_validations_callbacks.textile index 600681ddd3..2a1e9bfc0c 100644 --- a/railties/guides/source/active_record_validations_callbacks.textile +++ b/railties/guides/source/active_record_validations_callbacks.textile @@ -1192,13 +1192,11 @@ h4. Creating Observers For example, imagine a +User+ model where we want to send an email every time a new user is created. Because sending emails is not directly related to our model's purpose, we should create an observer to contain the code implementing this functionality. -Rails can create the initial code of the observers in a simple way. For instance, given a model +User+, the command - <shell> $ rails generate observer User </shell> -generates file +app/models/user_observer.rb+ containing the observer class +UserObserver+: +generates +app/models/user_observer.rb+ containing the observer class +UserObserver+: <ruby> class UserObserver < ActiveRecord::Observer |