fix sku variant values association on variants table
git st
This commit is contained in:
parent
e9ba1845ba
commit
44130c0cd2
|
@ -62,9 +62,11 @@ class ProductVariantsTable extends Table
|
||||||
'joinType' => 'INNER',
|
'joinType' => 'INNER',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->hasMany('ProductCategoryVariantOptions', [
|
$this->hasMany('ProductSkuVariantValues', [
|
||||||
'className' => 'CakeProducts.Products',
|
'className' => 'CakeProducts.ProductSkuVariantValues',
|
||||||
'foreignKey' => 'product_category_variant_id',
|
'foreignKey' => 'product_variant_id',
|
||||||
|
'dependent' => true,
|
||||||
|
'cascadeCallbacks' => true,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ class ProductVariantsTableTest extends TestCase
|
||||||
$expectedAssociations = [
|
$expectedAssociations = [
|
||||||
'Products',
|
'Products',
|
||||||
'ProductCategoryVariants',
|
'ProductCategoryVariants',
|
||||||
'ProductCategoryVariantOptions',
|
'ProductSkuVariantValues',
|
||||||
];
|
];
|
||||||
$associations = $this->ProductVariants->associations();
|
$associations = $this->ProductVariants->associations();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue