title: Can I make a belongs_to association use eager loading by default?
body: <p>I am connecting to one of my company's SQL Server databases, and trying to set up ActiveRecord so I can treat them just the same as Rails objects.</p>
  
  <p>I have these two models:</p>
  
  <pre><code>class Change &lt; ActiveRecord::Base
    belongs_to :affected_contact, class_name: "Contact"
  end
  
  class Contact
    # Contact's primary key is a binary UUID; I can't change this
  end
  </code></pre>
  
  <p>I am trying to get the affected contact of one particular change. Normally, this would be a simple case, but:</p>
  
  <pre><code>Change.first.affected_contact
    Change Load (52.6ms)  EXEC sp_executesql N'SELECT TOP (1) [chg].* FROM [chg] ORDER BY [chg].[id] ASC'
    Contact Load (28.0ms)  EXEC sp_executesql N'SELECT TOP (1) [ca_contact].* FROM [ca_contact] WHERE [ca_contact].[contact_uuid] = @0', N'@0 binary', @0 = 0xfcf9a8ac6381aa4386c9b10ee382e10b  [["contact_uuid", "&lt;16 bytes of binary data&gt;"]]
  =&gt; nil
  </code></pre>
  
  <p>... that's not what I want! And yet, if I eager-load the join first, it works:</p>
  
  <pre><code>Change.eager_load(:affected_contact).first.affected_contact
    SQL (34.4ms)  EXEC sp_executesql N'SELECT TOP (1) holy_crap_theres_a_lot_of_columns FROM [chg] LEFT OUTER JOIN [ca_contact] ON [ca_contact].[contact_uuid] = [chg].[affected_contact] ORDER BY [chg].[id] ASC'
  =&gt; #&lt;Contact contact_uuid: "\xFC\xF9\xA8\xACc\x81\xAAC\x86\xC9\xB1\x0E\xE3\x82\xE1\v", ... &gt;
  </code></pre>
  
  <p>In fact, if I force the matching to happen in the <code>JOIN</code> clause in any way, it will work, but <code>belongs_to</code> seems to use the <code>WHERE</code> clause instead, and <code>nil</code> is the best response I can get (a lot of the time, there are conversion errors between the string and its binary type).</p>
  
  <p>Is there a way to ensure eager-loading through the <code>JOIN</code> clause happens by default on the <code>belongs_to</code> association?</p>