Skip to content

Commit

Permalink
Merge branch '2.2-habtmmerge'
Browse files Browse the repository at this point in the history
  • Loading branch information
ceeram committed Aug 24, 2012
2 parents dcc5a95 + cb80338 commit f06ce13
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions lib/Cake/Model/Model.php
Expand Up @@ -1745,7 +1745,6 @@ public function save($data = null, $validate = true, $fieldList = array()) {

if ($success && $count > 0) {
if (!empty($this->data)) {
$success = $this->data;
if ($created) {
$this->data[$this->alias][$this->primaryKey] = $this->id;
}
Expand All @@ -1755,7 +1754,7 @@ public function save($data = null, $validate = true, $fieldList = array()) {
$this->getEventManager()->dispatch($event);
}
if (!empty($this->data)) {
$success = Hash::merge($success, $this->data);
$success = $this->data;
}
$this->data = false;
$this->_clearCache();
Expand Down
1 change: 1 addition & 0 deletions lib/Cake/Test/Case/Model/BehaviorCollectionTest.php
Expand Up @@ -888,6 +888,7 @@ public function testBehaviorSaveCallbacks() {
$Sample->Behaviors->attach('Test', array('beforeSave' => 'off', 'afterSave' => 'test'));
$Sample->create();
$expected = $record;
unset($expected['Sample']['name']);
$result = $Sample->save($record);
$expected['Sample']['id'] = $Sample->id;
$this->assertSame($expected, $result);
Expand Down
1 change: 0 additions & 1 deletion lib/Cake/Test/Case/Model/ModelCrossSchemaHabtmTest.php
Expand Up @@ -213,7 +213,6 @@ public function testHabtmWithThreeDatabases() {
'Armor' => array(
'Armor' => array(
1, 2, 3, 4,
1, 2, 3, 4,
),
),
);
Expand Down
1 change: 1 addition & 0 deletions lib/Cake/Test/Case/Model/ModelWriteTest.php
Expand Up @@ -1170,6 +1170,7 @@ public function testSaveHabtm() {
$this->assertFalse(empty($result));
$result = $TestModel->save();
$this->assertFalse(empty($result));
$this->assertEquals($data['Tag'], $result['Tag']);

$TestModel->unbindModel(array('belongsTo' => array('User'), 'hasMany' => array('Comment')));
$result = $TestModel->find('first', array('fields' => array('id', 'user_id', 'title', 'body'), 'conditions' => array('Article.id' => 2)));
Expand Down

0 comments on commit f06ce13

Please sign in to comment.