eager

Hi

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

how can i do it?

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

Hi,

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.

Product.find(:all,:include=>{:stores=>:store_shipping_countries})

Regards,

javier ramirez