I’ve got a table that contains addresses. Addresses belong_to users.
When a new address is added, I would like to avoid duplicates. The
should check to see if it is exactly the same as an existing address,
it is, instead of saving the address and returning a new record, I would
like it to load the old record.
I’m thinking something like this:
if old_record = this_is_a_duplicate_record
this.id = old_record.id
… is this the way to do it? Or is there a better/safer method?