title: ActiveRecord - Prevent duplicate entries across tables
body: <p>I have two models (and tables) in my Rails project.  Each model has an "Address" field.</p>
  
  <p>Currently, I have my code set to validate the uniqueness of the Address in each model, and on each table there is an index for the Address to prevent duplicates in the case of multiple connections trying to save the same data.</p>
  
  <p>However, I would like to ensure that the Address field is <strong>unique across the two tables</strong>.  As in, if the Address exists in one table, it could not be saved into the second table.</p>
  
  <p>Solving that in code isn't that tough, but how would I implement that check at the database level (similar to an index) to ensure that no non-unique values are ever saved?</p>