Commit 0b7f6491 by Alexander Makarov

Fixed setting defaults in User model of advanced app, see bb145f50

parent 18e44195
...@@ -45,6 +45,20 @@ class User extends ActiveRecord implements IdentityInterface ...@@ -45,6 +45,20 @@ class User extends ActiveRecord implements IdentityInterface
} }
/** /**
* @inheritdoc
*/
public function rules()
{
return [
['status', 'default', 'value' => self::STATUS_ACTIVE],
['status', 'in', 'range' => [self::STATUS_ACTIVE, self::STATUS_DELETED]],
['role', 'default', 'value' => self::ROLE_USER],
['role', 'in', 'range' => [self::ROLE_USER]],
];
}
/**
* @inheritdoc * @inheritdoc
*/ */
public static function findIdentity($id) public static function findIdentity($id)
......
...@@ -48,7 +48,7 @@ class SignupForm extends Model ...@@ -48,7 +48,7 @@ class SignupForm extends Model
$user->email = $this->email; $user->email = $this->email;
$user->setPassword($this->password); $user->setPassword($this->password);
$user->generateAuthKey(); $user->generateAuthKey();
$user->save(false); $user->save();
return $user; return $user;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment