title: Rails: Validate uniqueness with a scope coming from another model
body: <p>I am not sure how to express this properly so here is the data structure:
  In my Rails 6 application, I have a model actor and a model aka (for &quot;also known as&quot; - as some actors have different names at times).</p>
  <p>Both models have first and last names. What I want to do is ensure I do not store the same &quot;aka&quot; for an actor twice, however in theory, it should be possible that two actors have the same aka.
  Example: Actor &quot;John Doe&quot; might be known also as &quot;Joe Doe&quot; (aka). Actor &quot;Jon Doe&quot; might also be known as &quot;Joe Doe&quot;.
  So while I want to ensure I don't have &quot;Joe Doe&quot; as aka for &quot;John Doe&quot; - I want to ensure that it is possible to have two &quot;Joe Doe&quot;'s - once for &quot;John Doe&quot; and once for &quot;Jon Doe&quot;.</p>
  <p>So far, my validation for aka is:</p>
  <pre><code>....
  validates :first_name, presence: true
  validates :first_name, uniqueness: { scope: :last_name }
  
  belongs_to :actor
  ....
  </code></pre>
  <p>What do I need to add as a validation to reflect above dependency?</p>