Create an observer for the message model and do your updates.

On Sep 29, 12:59 pm, Fernando Perez <[email protected]>
wrote:
> Let's say I have the following models:
>
> User, has_many :messages, :topics
> Forum, has_many :topics
> Topic, belongs_to :user, has_many :messages
> Message, belongs_to :user, :topic
>
> How to tell both User and Topic, that a new Message has been created?
>
> I can do: @user.messages << @message, but what to do to notify the
> @topic? Is it possible to do that in a pretty manner?
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to