title: Rails scope when upgrading from 3 to 4
body: <p>While upgrading from Rails 3 to Rail 4, I got an "Invalid mix of scope block and deprecated finder options on ActiveRecord association" error. There are several posts on this issue, and some of them use a format like:</p>
  
  <pre><code>has_many :readable_exams,
           -&gt; { where trashed_at: nil },
           through: :student
  </code></pre>
  
  <p>However, I'm getting the invalid error when I use this format. On the other hand, when I do:</p>
  
  <pre><code>has_many :readable_exams,
           -&gt; { where(trashed_at: nil)
                .through(:student) }
  </code></pre>
  
  <p>no error gets thrown. Can anyone explain why through is throwing an error in the first case, but not the second?</p>
  
  <p><strong>Edit:</strong>
  It turns out my error was coming from a with_options block wrapping the has_many that I ignored previously. </p>
  
  <pre><code>with_options source: :exams,
               primary_key: "student_id",
               group: "exams.id" do |user| # This was throwing the error
      user.has_many :readable_exams,
                    -&gt; { where trashed_at: nil },
                    through: :student
      ...
  </code></pre>