i’m trying to have an eager loading on 4 tables.
those tables are :
products, store_entries, stores, store_shipping_countries.
and i don’t know how to load “store_shipping_countries” in the include
parameter when i do a Product.find
i’m trying to have an eager loading on 4 tables.
those tables are :
products, store_entries, stores, store_shipping_countries.
and i don’t know how to load “store_shipping_countries” in the include
parameter when i do a Product.find
i already do a “:through” to access store from product.
so i tried in product :
has_many :store_shipping_countries, :through => :stores
but it doesn’t work.
if none can help, i think i will use find_by_sql instead of the
regular find
i already do a “:through” to access store from product.
so i tried in product :
has_many :store_shipping_countries, :through => :stores
but it doesn’t work.
Assuming you have a relationship called “stores” from product and
another called “store_shipping_countries” from stores, then this should
work fine.