Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

So, this actually lets unit tests pass ...

  • Loading branch information...
commit bfa54cbee0816ae4f5b236717788a82c3a496231 1 parent 38b16c2
@DaSourcerer authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 framework/db/ar/CActiveRecord.php
View
8 framework/db/ar/CActiveRecord.php
@@ -1067,9 +1067,13 @@ public function update($attributes=null)
Yii::trace(get_class($this).'.update()','system.db.ar.CActiveRecord');
if($this->_pk===null)
$this->_pk=$this->getPrimaryKey();
- if(empty($this->_dirtyAttributes))
+ if($attributes===null)
+ $attributes=empty($this->_attributes)?null:$this->_dirtyAttributes;
+ else
+ $attributes=array_intersect($this->_dirtyAttributes,$attributes);
+ if(empty($attributes))
return true;
- $this->updateByPk($this->getOldPrimaryKey(),$this->getAttributes(array_intersect($this->_dirtyAttributes,($attributes===null)?array():$attributes)));
+ $this->updateByPk($this->getOldPrimaryKey(),$this->getAttributes($attributes));
$this->_pk=$this->getPrimaryKey();
$this->afterSave();
return true;
Please sign in to comment.
Something went wrong with that request. Please try again.