# RE: I need superman!

**URL:** <https://www.ruby-forum.com/t/re-i-need-superman/52790>\
**Category:** Rails\
**Created:** [January 19, 2006, 3:07am UTC](https://www.ruby-forum.com/t/re-i-need-superman/52790 "2006-01-19T03:07:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neville\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/ea666f/32.png) [@Neville\_B](https://www.ruby-forum.com/u/Neville_B)\
**Post date:** [January 19, 2006, 3:07am UTC](https://www.ruby-forum.com/t/re-i-need-superman/52790/1 "2006-01-19T03:07:24Z")

</div>

I think you should be able to make it work manually, although you miss  
out on some rails ‘magic’ because of your schema requirements. For  
example [psuedo rails code which doesn’t take into account reserved  
words, mysql quirks etc]

class Child \< ActiveRecord::Base  
def find\_parent  
Parent.find\_all :conditions =\> [‘number = ?’, item\_number[0…-3] +  
‘00’ ]  
end  
end

class Parent \< ActiveRecord::Base  
def find\_children  
Child.find\_all :conditions =\> [‘item\_number like ?’, number[0…-3] +  
‘%’ ]  
end  
end

HTH
