title: find_by inside a scope is firing 2 queries
body: <p>I am using Rails 4.2.3 and ruby 2.2.1</p>
  
  <p>I have written a scope in roles model as follows:</p>
  
  <p>app/models/role.rb</p>
  
  <pre><code>scope :default, -&gt; { find_by(default: true) }
  </code></pre>
  
  <p>Now when I run</p>
  
  <pre><code>&gt; Role.default
  
  #this is the output I got.
  
  Role Load (0.1ms)  SELECT  `roles`.* FROM `roles` WHERE `roles`.`default` = 1 LIMIT 1 
  Role Load (0.1ms)  SELECT `roles`.* FROM `roles`
  =&gt; []
  </code></pre>
  
  <p>As you can see this fires 2 queries and returns wrong result.</p>
  
  <p>I tried with class method instead of scope</p>
  
  <pre><code>def self.default
    self.find_by(default: true)
  end
  </code></pre>
  
  <p>Now when I run </p>
  
  <pre><code>Role.default
  
  #this is the output I got
  
  Role Load (0.2ms)  SELECT  `roles`.* FROM `roles` WHERE `roles`.`default` = 1 LIMIT 1
  =&gt; nil
  </code></pre>
  
  <p>With class method find_by is working properly.</p>
  
  <p>I am not able to understand what am I doing wrong here. Any help would be appreciated. Thanks in advance.</p>