Skip to content

Commit

Permalink
Fixing issues in ContainableBehavior that could leave models unbound …
Browse files Browse the repository at this point in the history
…when 'fields' was used as part of containment conditions. Fixes #253
  • Loading branch information
markstory committed Nov 7, 2009
1 parent dd0c4a6 commit 6db91b0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cake/libs/model/behaviors/containable.php
Expand Up @@ -155,7 +155,7 @@ function beforeFind(&$Model, $query) {
if (!$reset && empty($instance->__backOriginalAssociation)) {
$instance->__backOriginalAssociation = $backupBindings;
} else if ($reset) {
$instance->__backAssociation[$type] = $instance->{$type};
$instance->__backAssociation[$type] = $backupBindings[$type];
}
$instance->{$type}[$assoc] = array_merge($instance->{$type}[$assoc], $model['keep'][$assoc]);
}
Expand Down
2 changes: 1 addition & 1 deletion cake/tests/cases/libs/model/behaviors/containable.test.php
Expand Up @@ -3390,7 +3390,7 @@ function testResetDeeperHasOneAssociations() {
)
));
$this->assertEqual($expected, $this->Article->User->hasOne);

$this->Article->User->bindModel($userHasOne, false);
$expected = $this->Article->User->hasOne;
$this->Article->find('all', array(
Expand Down

0 comments on commit 6db91b0

Please sign in to comment.