Forum: Ruby on Rails RE: I need superman!

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Neville B. (Guest)
on 2006-01-19 04:07
(Received via mailing list)
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' ]

class Parent < ActiveRecord::Base
  def find_children
    Child.find_all :conditions => ['item_number like ?', number[0..-3] +
'%' ]

This topic is locked and can not be replied to.