mike
2007-Sep-08 17:32 UTC
hook into appending child records to parent in acts_as_tree association
I have a class with an acts_as_tree association and I''d like to add some additional functionality to take place whenever I try to append something to an instances child list. So when I try something like my_object.children << another_object I''d like to call a method or override whatever method I need to do so. Thanks, I welcome any advice. -Mike --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jamal Soueidan
2007-Sep-09 08:41 UTC
Re: hook into appending child records to parent in acts_as_t
mike wrote:> I have a class with an acts_as_tree association and I''d like to add > some additional functionality to take place whenever I try to append > something to an instances child list. So when I try something like > my_object.children << another_object I''d like to call a method or > override whatever method I need to do so. Thanks, I welcome any > advice. -MikeYou can override the method and do whatever you want in your model :) -- Posted via http://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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---