m b
07/27/2023, 1:08 PMSpree::LineItem
.includes(variant: { product: :taxons })
.where(spree_variants: { spree_products: { spree_taxons: { id: [413, 429] } } })
however, sadly, it's giving me
undefined method `key?' for nil:NilClass (NoMethodError)
klass&.columns_hash.key?(column_name)
error (which looks like some unhandled internal rails case) so there is something wrong either with includes or with all these nested where conditions but i already spent couple of hours trying to understand what the issue might be and i reached dead end. Can you see anything wrong with my query method chain? I would really appreciate your help with this one ๐kennyadsl
Chris Todorov
07/27/2023, 6:07 PMwhere
Spree::LineItem.includes(variant: { product: :taxons }).where(spree_taxons: { id: [413, 429] })
m b
07/27/2023, 6:08 PMnot
after where
(which is what i actually need, i just simplified the question) doesn't return proper line items. It returns these with the unwanted taxons anywayChris Todorov
07/27/2023, 6:23 PMincludes
maybe try using joins
insteadm b
07/27/2023, 6:24 PMChris Todorov
07/27/2023, 6:24 PMIt returns these with the unwanted taxons anywayAre you saying that it's not excluding the taxon id's like you expect?
Chris Todorov
07/27/2023, 6:25 PMChris Todorov
07/27/2023, 6:26 PMChris Todorov
07/27/2023, 6:27 PMm b
07/27/2023, 6:27 PM