replace_refs_with_ids support for long types in 'has_one' fields