Does anyone know why we have a `having` in the `Sp...
# support
b
Does anyone know why we have a
having
in the
Spree::ShippingMethod.with_all_shipping_category_ids
? https://github.com/solidusio/solidus/blob/main/core/app/models/spree/shipping_method.rb#L47 Like, what is the function of checking the count of the ids returned compared to the list of ids supplied? If I supply a subset of the available shipping methods, shouldn't that be fine? Or rather, shouldn't the count of the shipping methods ids >= ids.count rather than equal to?
m
I think the point here is that without this, we'd get shipping methods that only work for one of the shipping categories. Since we're counting on a join table, we're already ignoring shipping categories that we don't need.
b
Thanks, I've always wondering about that having.
k