Commit 0b7f6491 by Alexander Makarov

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

parent 18e44195
......@@ -47,6 +47,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
*/
public static function findIdentity($id)
{
return static::findOne($id);
......
......@@ -48,7 +48,7 @@ class SignupForm extends Model
$user->email = $this->email;
$user->setPassword($this->password);
$user->generateAuthKey();
$user->save(false);
$user->save();
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