A bag of oranges that is ripe.
A bag of oranges that are ripe.
Should bag or oranges agree with the verb here? I think are is the correct choice here because oranges are what's ripe in this case. But if the sentence was something like
A bag of oranges that is torn
It would be is because the bag is the subject that is torn.
Is this the right way to think about this?