hi, i want to do it with activerecords: parent.children.my_method. in "my_method" i have a find_by_sql and need to know "parent" attributes. how do i get them? regards --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
self.parent On Dec 9, 2007 3:05 PM, Jean-Sébastien <jeansebastien.ney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > hi, > i want to do it with activerecords: parent.children.my_method. > in "my_method" i have a find_by_sql and need to know "parent" > attributes. how do i get them? > > regards > > >-- Cheers! - Pratik http://m.onkey.org --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
thanks pratik (i love your blog). I think i didn''t explain it good enough: parent object can be whatever class and i want to accessed parent object from children method. On Dec 9, 5:45 pm, Pratik <pratikn...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> self.parent > > On Dec 9, 2007 3:05 PM, Jean-Sébastien <jeansebastien....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > hi, > > i want to do it with activerecords: parent.children.my_method. > > in "my_method" i have a find_by_sql and need to know "parent" > > attributes. how do i get them? > > > regards > > -- > Cheers! > - Pratikhttp://m.onkey.org--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---