title: How to write scope with belongs_to object?
body: <p>I have the following models</p>
  
  <p><em>Models</em></p>
  
  <pre><code>Job
    belongs_to :company
  Company
    has_many :jobs
  </code></pre>
  
  <p>Right now I select all the <code>Jobs</code>  which have an accepted <code>Company</code> using the following method:</p>
  
  <pre><code>def self.with_accepted_company
    Job.all.reject {|job| job.company.state != "accepted" }
  end
  </code></pre>
  
  <p>But I would like to use scope for that and use it with other scopes. Is this possible to write that scope in the <code>Job</code> model?</p>