Permalink
Browse files

Merge branch '3.2/develop' into 3.3/develop

refs (#4572)
  • Loading branch information...
2 parents 86d4889 + 4af8c37 commit d1795f69129f223f41e7a283a8ff98007539e653 @Zeelot Zeelot committed Jul 26, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 classes/Kohana/ORM.php
View
@@ -745,7 +745,9 @@ public function set($column, $value)
$this->_related[$column] = $value;
// Update the foreign key of this model
- $this->_object[$this->_belongs_to[$column]['foreign_key']] = $value->pk();
+ $this->_object[$this->_belongs_to[$column]['foreign_key']] = ($value instanceof ORM)
+ ? $value->pk()
+ : NULL;
$this->_changed[$column] = $this->_belongs_to[$column]['foreign_key'];
}

0 comments on commit d1795f6

Please sign in to comment.