Save association when primary key is manually set

`has_one` association was not saved with primary key manually set. The method `save_has_one_association` wasn't verifying if the relation was changed.

Fixes #12302