search for: child_thing_id

Displaying 1 result from an estimated 1 matches for "child_thing_id".

2006 Mar 29
4
:through alternate
...e has_many :child_things, :through => :thing_thing has_many :parent_things, :through => :thing_thing, :some_other_option? end class ThingThing < ActiveRecord::Base belongs_to :thing belongs_to :child_thing, :class_name => ''Thing'', :foreign_key => ''child_thing_id'' end The child_things works. The parent_things does not, or at least, I cannot figure out the sytnax. I would like it to issue an sql like: SELECT things.* FROM things INNER JOIN thing_things ON things.id = thing_things.thing_id WHERE (thing_things.child_thing_id = 6201) Is there a wa...