fixed an issue with has_one saving in Rails