I need to get a subset of an objects collection. Sort of like
named_scope but for a specific model instance.
Foo has_many :bar
Bar has_many :buzz
I want all of the bars for a specific foo but I only want to consider
bars without buzz.
The best I can come up with is using a “select”
foo.bars.select { |bar| bar.buzzs.empty? }
Is there a better way to do this?
TIA
Sean