Skip to content

Instantly share code, notes, and snippets.

@reagent
Created May 2, 2012 18:42
class Family < ActiveRecord::Base
def self.with_discontinued_accessories
joins(:products).where({
:products => {
:accessory => true,
:production_status => 'discontinued',
:active => true,
:parent_id => nil
}
}).uniq
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment