Merge pull request #12760 from pseidemann/master

fix simple_format escapes own output when sanitize is set to true
Fixes problem with replacing has_one association record with itself
fix proposed by Sergio Cambra