# Nested find

**URL:** <https://www.ruby-forum.com/t/nested-find/122569>\
**Category:** Rails\
**Created:** [December 9, 2007, 4:06pm UTC](https://www.ruby-forum.com/t/nested-find/122569 "2007-12-09T16:06:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/49beb7/32.png) [@jney](https://www.ruby-forum.com/u/jney)\
**Post date:** [December 9, 2007, 4:06pm UTC](https://www.ruby-forum.com/t/nested-find/122569/1 "2007-12-09T16:06:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/49beb7/32.png) [@jney](https://www.ruby-forum.com/u/jney)\
**Post date:** [December 9, 2007, 5:47pm UTC](https://www.ruby-forum.com/t/nested-find/122569/2 "2007-12-09T17:47:09Z")

</div>

self.parent

On Dec 9, 2007 3:05 PM, Jean-Sébastien [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
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](http://m.onkey.org)

---

<div class="post-metadata">

**Author:** ![jney](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/49beb7/32.png) [@jney](https://www.ruby-forum.com/u/jney)\
**Post date:** [December 9, 2007, 9:05pm UTC](https://www.ruby-forum.com/t/nested-find/122569/3 "2007-12-09T21:05:02Z")

</div>

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.
