The behavior doesn't check that the associated model exists before calling save(). This can, in certain circumstances, cause the behavior to create errant records in the database which is likely not desirable.
The proposed change simply checks that the associated model exists before issuing the save. If the model does not exist then it silently doesn't do anything (whether it should throw an error is up for debate).
The behavior doesn't check that the associated model exists before calling save(). This can, in certain circumstances, cause the behavior to create errant records in the database which is likely not desirable.
The proposed change simply checks that the associated model exists before issuing the save. If the model does not exist then it silently doesn't do anything (whether it should throw an error is up for debate).