Fixing cascading delete, when using foreignKey false and setting condition on hasOne.

This commit is contained in:
Ceeram 2011-11-30 20:02:36 +01:00
parent 87a8af420f
commit b5c4b85601
6 changed files with 265 additions and 5 deletions

View file

@ -1001,6 +1001,69 @@ class Bid extends CakeTestModel {
public $belongsTo = array('Message');
}
/**
* BiddingMessage class
*
* @package Cake.Test.Case.Model
*/
class BiddingMessage extends CakeTestModel {
/**
* name property
*
* @var string 'BiddingMessage'
*/
public $name = 'BiddingMessage';
/**
* primaryKey property
*
* @var string 'bidding'
*/
public $primaryKey = 'bidding';
/**
* belongsTo property
*
* @var array
*/
public $belongsTo = array(
'Bidding' => array(
'foreignKey' => false,
'conditions' => array('BiddingMessage.bidding = Bidding.bid')
)
);
}
/**
* Bidding class
*
* @package Cake.Test.Case.Model
*/
class Bidding extends CakeTestModel {
/**
* name property
*
* @var string 'Bidding'
*/
public $name = 'Bidding';
/**
* hasOne property
*
* @var array
*/
public $hasOne = array(
'BiddingMessage' => array(
'foreignKey' => false,
'conditions' => array('BiddingMessage.bidding = Bidding.bid'),
'dependent' => true
)
);
}
/**
* NodeAfterFind class
*