Permalink
Browse files

Fixing issues in ContainableBehavior that could leave models unbound …

…when 'fields' was used as part of containment conditions. Fixes #253
  • Loading branch information...
1 parent dd0c4a6 commit 6db91b0f49b71dcc1200dfb9fb95841bfb1525a1 @markstory markstory committed Nov 7, 2009
@@ -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]);
}
@@ -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(

0 comments on commit 6db91b0

Please sign in to comment.