Hi all,
I need some hints and suggestions on setting up a correct self-
reference table relationship.
The database is populated externally with text data, and I want to use
only this data to declare the parent-child relationship.
Assuming we have following pseudo structure for a person. It also
includes the name of the mother as "first_name last_name"
class Person < ActiveRecord::Base
hobo_model
fields do
first_name :string
last_name :string
mother :string
end
belongs_to :mother
has_many :childs, :finder_sql => "select * from persons where mother =
"#{first_name} #{last_name}""
Would be nice to get some ideas, hopefully circumventing a has_many
childs :through parentship relationship!
Thanks,
Sebastian
--
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/hobousers?hl=en.