title: Help me with scopes and conditions
body: <p>My model:</p>
  
  <pre><code>Subscriber  
  has_and_belongs_to_many :skills
  
  Skill
  has_many :positions
  
  Position
  belongs_to :skill
  </code></pre>
  
  <p>I want to find all subscribers that have positions which...<br>
    1. are created during last day<br>
    2. are created after the subscriber was created</p>
  
  <p>First condition is easy (<em>subscriber.rb</em>):</p>
  
  <pre><code> scope :notify_today, 
   includes(:skills =&gt; :positions).where('positions.created_at &gt; ?', 1.day.ago)
  </code></pre>
  
  <p>For the second condition <a href="https://stackoverflow.com/questions/4906229/activerecord-conditions-and-named-scope-undefined-method-created-at">it was suggested</a> to use lambda, but I didn't quite get it - I'm a newbie...</p>
  
  <p>I'm using the scope in a <em>cron.rake</em> file to send email notifications to subscribers:  </p>
  
  <pre><code>Subscriber.notify_today.each {|subsc| UserMailer.delay.new_positions_mail(subsc)}
  </code></pre>