Fixes problem with replacing has_one association record with itself

fix proposed by Sergio Cambra
tests updated to reflect the issue