RE: I need superman!

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs