Browse Source

&& => || fix

tags/2.0.0-alpha
Alexander Kochetov 12 years ago
parent
commit
e3f6faf575
  1. 4
      framework/db/ActiveRecord.php

4
framework/db/ActiveRecord.php

@ -667,7 +667,7 @@ class ActiveRecord extends Model
*/
public function insert($runValidation = true, $attributes = null)
{
if ($runValidation && !$this->validate($attributes) && !$this->beforeSave(true)) {
if ($runValidation && !$this->validate($attributes) || !$this->beforeSave(true)) {
return false;
}
$values = $this->getDirtyAttributes($attributes);
@ -747,7 +747,7 @@ class ActiveRecord extends Model
*/
public function update($runValidation = true, $attributes = null)
{
if ($runValidation && !$this->validate($attributes) && !$this->beforeSave(false)) {
if ($runValidation && !$this->validate($attributes) || !$this->beforeSave(false)) {
return false;
}
$values = $this->getDirtyAttributes($attributes);

Loading…
Cancel
Save