I don’t understand where there can be a mistake
class User extends ActiveRecord {
public $role; // this field is not in the users table
public function afterFind()
{
$this->role = '...'; // I get a value from another table (from auth_assignment)
}
public function afterSave($insert, $changedAttributes)
{
var_dump($this->isAttributeChanged('role')); // return false;
var_dump($this->isAttributeChanged('role', false)); // return false;
var_dump($changedAttributes); // in this array there is no my changed attribute
}
}