ソースを参照

Fixate the sort for an association.

Having a fixed sort should help stabilize Postgres builds.
Mark Story 11 年 前
コミット
efdcef56ca
1 ファイル変更4 行追加1 行削除
  1. 4 1
      tests/TestCase/ORM/QueryTest.php

+ 4 - 1
tests/TestCase/ORM/QueryTest.php

@@ -429,7 +429,10 @@ class QueryTest extends TestCase
         $article = TableRegistry::get('articles');
         $post = TableRegistry::get('posts');
 
-        $author->hasMany('posts', compact('strategy'));
+        $author->hasMany('posts', [
+            'sort' => ['posts.id' => 'ASC'],
+            'strategy' => $strategy
+        ]);
         $article->belongsTo('authors');
 
         $query = new Query($this->connection, $article);