In Rails, how can I setup my HABTM when I have two models on different databases?
<p>I have two models as outlined below.  I have a joins table I want to specify, but it errors out since they're not in the same database.  If I specify my development database in my "join_table:" options hash then it works.  But of course that would break when moving up to production.</p>

<p><strong>Error</strong></p>

<pre><code>TinyTds::Error: Invalid object name 'ncaa_matches'.: EXEC sp_executesql N'SELECT 1 AS one FROM [player_extracts] INNER JOIN [ncaa_matches] ON [player_extracts].[college_player_id] = [ncaa_matches].[ncaa_id] WHERE [ncaa_matches].[player_id] = @0 ORDER BY [player_extracts].[college_player_id] ASC OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY', N'@0 int', @0 = 247489
</code></pre>

<p><strong>Model A</strong></p>

<pre><code>class PlayerExtract &lt; IncomingModel
  self.table_name = 'player_extracts'
  self.primary_key = 'player_id'

  has_and_belongs_to_many :players, join_table: "ncaa_matches", association_foreign_key: 'player_id', uniq: true
end
</code></pre>

<p><strong>Model B</strong></p>

<pre><code>class Player &lt; ActiveRecord::Base
    has_and_belongs_to_many :player_extracts, join_table: "ncaa_matches", association_foreign_key: 'ncaa_id', uniq: true
end
</code></pre>