active-record icon indicating copy to clipboard operation
active-record copied to clipboard

AR::refresh() takes default condition into account

Open cebe opened this issue 10 years ago • 1 comments

Not sure if it should be like this but if find() is overridden with a default condition, this will affect refresh() so that it will return false even if the row exists, but just does not match the condition anymore. I would expect refresh() to refresh the record regardless of any default condition.

cebe avatar Mar 05 '15 01:03 cebe

Hm... I also can not reset loaded relations when the record is not found in DB. https://github.com/yiisoft/yii2/blob/master/framework/db/BaseActiveRecord.php#L947

cebe avatar Mar 05 '15 01:03 cebe