Forum: Ruby on Rails multi level has_many through

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.
4b87f676cb6c4d648d71000681823693?d=identicon&s=25 Jean-sébastien Jney (jney)
on 2007-05-03 20:23
(Received via mailing list)

how can i use has_many through for class further then 2 levels
i have 4 classes :

and i try to access StoreShippingCountry from Product

what i do :

class Product < ActiveRecord::Base
  has_many   :store_entries
  has_many   :stores,
    :through    => :store_entries
  has_many   :store_shipping_countries,
    :through => :store_entries,
    :source  => :stores

and here is the error i recieve :
Could not find the source association(s) :stores in model StoreEntry.
Try 'has_many :store_shipping_countries, :through
=> :store_entries, :source => <name>'.  Is it one
of :issues, :store, :prices, :store_shipping_countries, :guarantees,
or :actions?

Can someone help me?
Ae16cb4f6d78e485b04ce1e821592ae5?d=identicon&s=25 Martin DeMello (Guest)
on 2007-06-11 14:39
(Received via mailing list)
Any answer to this? Or is it definitely not possible?

This topic is locked and can not be replied to.