title: Error trying to call a method on an object that belongs to another object
body: <p>I have recs, which belong to a list, and lists, which have many recs.  I am trying to figure out why I can't call my 'to_do' method below on the recs that belong to a list?  This is in the 2nd row of view code.  I'm getting the following error:</p>
  
  <p>SQLite3::SQLException: near ")": syntax error: SELECT "recs".* FROM "recs"  WHERE "recs"."list_id" = ? AND (done = 'false'))</p>
  
  <p>Rec Model</p>
  
  <pre><code>class Rec &lt; ActiveRecord::Base
    belongs_to :list
    scope :to_do, lambda {where("done = ?)", 'false')}
  end
  </code></pre>
  
  <p>List model</p>
  
  <pre><code>class List &lt; ActiveRecord::Base
        has_many :recs
  end
  </code></pre>
  
  <p>Controller</p>
  
  <pre><code>  def index
      @recs = Rec.to_do
      @lists = List.all
      @networks = Network.all
    end
  </code></pre>
  
  <p>View</p>
  
  <pre><code>  &lt;% network.lists.eat_lists.each do |list| %&gt;
      &lt;% if list.recs.to_do.present? %&gt;
        &lt;%= list.name %&gt;&lt;/br&gt;
        &lt;% list.recs.each do |rec| %&gt;
          &lt;%= rec.name.split(',').first %&gt;
          &lt;%= rec.notes %&gt;
          &lt;%= rec.done %&gt;
          &lt;%= link_to 'Done', marked_as_done_url(rec), method: :patch %&gt;&lt;/br&gt;
          &lt;%= link_to 'Delete', rec, method: :delete %&gt;&lt;/br&gt;
        &lt;% end %&gt;
      &lt;% end %&gt;
    &lt;% end %&gt;
  </code></pre>