Fixed issue with foreign keys not being set on :has_one associations