1
我在我的Rails 3.2應用程序中使用Spree,我想知道如何創建我自己定義的一些模型和Spree::Product
之間的關係。與Spree的關係::產品
例如,在一家服裝店,我希望通過收藏品(Collection
是我的一個假設模型)做羣組產品(Spree::Product
)。
如何在Collection
中聲明關於Spree::Product
對象的has_many
關係?
P.S:我在我的模型中嘗試過has_many :products
和has_many :spree_products
,但它們都不起作用。
嗯,好吧,但是如果我想在我的Collection模型中聲明'has_many'關係如'has_many:products'呢? – rodrigoalves
'belongs_to:collection' &&'has_many:spree_products,:class_name =>「Spree :: Product」'應該能正常工作嗎? – drhenner