mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Add deterministic ordering to translate associations.
Having a deterministic ordering based on the primary key resolves tests potentially failing when postgres returns data in a non-sequential order.
This commit is contained in:
parent
b5050db643
commit
4b5783c5fe
1 changed files with 2 additions and 1 deletions
|
@ -590,7 +590,8 @@ class TranslateBehavior extends ModelBehavior {
|
||||||
$RuntimeModel = $this->translateModel($Model);
|
$RuntimeModel = $this->translateModel($Model);
|
||||||
$default = array(
|
$default = array(
|
||||||
'className' => $RuntimeModel->alias,
|
'className' => $RuntimeModel->alias,
|
||||||
'foreignKey' => 'foreign_key'
|
'foreignKey' => 'foreign_key',
|
||||||
|
'order' => 'id'
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ($fields as $key => $value) {
|
foreach ($fields as $key => $value) {
|
||||||
|
|
Loading…
Reference in a new issue