title: How to write oracle hint in rails scope method
body: <p>In my rails model I have a scope method</p>
  
  <pre><code>class User
    scope :failed,
      :select =&gt; %{
        /*+ some hint */ *
      } ,
      :joins =&gt; :address,
      :conditions =&gt; %{
        addresses.location_id IS NULL
      }
  </code></pre>
  
  <p>My problem is first is this the right way of introducing hint in scope method and second when I run <code>User.failed.count</code> it doesn't consider the hint. Please help</p>
  
  <p>This is the sql generated when  I call <code>User.failed</code></p>
  
  <pre><code>SELECT /*+ some hint */ * FROM "SOME_SCHEMA"."USERS" INNER JOIN "SOME_SCHEMA"."ADDRESSES" ON "SOME_SCHEMA"."ADDRESSES"."ID" = "SOME_SCHEMA"."USERS"."ADDRESS_ID" WHERE (addresses.location_id IS NULL)
  </code></pre>
  
  <p>and this is the sql generated when I call <code>User.failed.count</code></p>
  
  <pre><code>SELECT COUNT(*) FROM "SOME_SCHEMA"."USERS" INNER JOIN "SOME_SCHEMA"."ADDRESSES" ON "SOME_SCHEMA"."ADDRESSES"."ID" = "SOME_SCHEMA"."USERS"."ADDRESS_ID" WHERE (addresses.location_id IS NULL)
  </code></pre>
  
  <p>Notice it skips the hint part.</p>