Skip to content

Commit

Permalink
Add deterministic ordering to translate associations.
Browse files Browse the repository at this point in the history
Having a deterministic ordering based on the primary key resolves
tests potentially failing when postgres returns data in a non-sequential
order.
  • Loading branch information
markstory committed Oct 25, 2014
1 parent b5050db commit 4b5783c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Cake/Model/Behavior/TranslateBehavior.php
Expand Up @@ -590,7 +590,8 @@ public function bindTranslation(Model $Model, $fields, $reset = true) {
$RuntimeModel = $this->translateModel($Model);
$default = array(
'className' => $RuntimeModel->alias,
'foreignKey' => 'foreign_key'
'foreignKey' => 'foreign_key',
'order' => 'id'
);

foreach ($fields as $key => $value) {
Expand Down

0 comments on commit 4b5783c

Please sign in to comment.