ActiveRecord::refresh() 不应清除所有关系,而只应清除对应外键发生变化的关系
作者: PowerGamer1创建于 2023年3月11日更新于 2026年5月27日
标签type:bug
The https://GitHub.com/yiisoft/yii2/pull/13618 introduced "magic" functionality that makes it look like changing the foreign key attribute of a model also changes the loaded relation model that depends on this foreign key. This was achieved by simply unsetting the affected relation (whose foreign key has changed).
内容来源: yiisoft/yii2