I want to find any product that has a higher ip_solid
than ip_liquid
.
I am trying to do the following:
Product.where("ip_solid > ?", :ip_liquid).count
However, it seems that :ip_liquid
is not being read out from each object, and is probably evaluating to 0 or nil. Is something like this even possible?
Product.where("ip_solid > ip_liquid").count
should do it as long as ip_liquid
is a field in the database and not a method on your model
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With