Skip to content
Browse files

Merge branch '2.3' of git://github.com/calinseciu/cakephp into calins…

…eciu-2.3
  • Loading branch information...
2 parents 99b798f + adb8142 commit e9db96bfe163609eeefba430d8353c822aabacb0 @ceeram ceeram committed Sep 6, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/Cake/Model/Model.php
View
4 lib/Cake/Model/Model.php
@@ -2266,6 +2266,10 @@ public function saveAssociated($data = null, $options = array()) {
$values[$i] = array_merge(array($key => $this->id), $value, array($key => $this->id));
}
}
+ // add foreignKey to whitelist if not already there
+ if (!in_array($key, $this->{$association}->whitelist)) {
+ $this->{$association}->whitelist[] = $key;
+ }
$_return = $this->{$association}->saveMany($values, array_merge($options, array('atomic' => false)));
if (in_array(false, $_return, true)) {
$validationErrors[$association] = $this->{$association}->validationErrors;

0 comments on commit e9db96b

Please sign in to comment.
Something went wrong with that request. Please try again.