title: scope with condition on different model
body: <p>i have following code:</p>
  
  <pre><code>class Item &lt; ActiveRecord::Base
    belongs_to :user
    has_many :transactions
  
    #scope :active, lambda??
  end
  
  class Transaction &lt; ActiveRecord::Base
    belongs_to :user
    belongs_to :item
  
    scope :active, where("status = 0")
  end
  
  class User &lt; ActiveRecord::Base
    has_many :items
    has_many :transactions
  
  end
  </code></pre>
  
  <p>i wish to build a scope in model Item to retrieve only records with active transactions, for example:</p>
  
  <pre><code>User.find(1).items.active
  </code></pre>