Fixed #10811 -- Error raised when assigning unsaved model to Foreign Key