Displaying 2 results from an estimated 2 matches for "commentobserver".
Did you mean:
comment_observer
2008 Apr 30
6
best practice for object transaction?
I have a new @offer that needs to generate a document if saved. But
that''s all or nothing:
transaction do
@offer.save!
generate_document
end
# handle exceptions if needed
If save! fails everything is fine, but if generate_document raises an
exception @offer is left as a model with timestamps, id, which is not
a new_record? anymore (though the database was
2009 Jul 20
0
Polymorphic Comment notification to Users?
...user_id (to whom the notification
should be sent if there is any new comment created with the matching
commentable and user?
How can I implement the association between Comment and Notification?
For the checking part if there is any one subscribe to the particular
commentable resource is create a CommentObserver with after_create
hook to initialize the search and send notifications if there is any
matching record.
But I''m confused what the association, model, controller and views
would look like to accomplish this? Since the comment model is already
polymorphic, can I create the Notification mode...