Hi
I wonder if there’s a way to do this without involving advance SQL code?
Model 1.
Product
:has_many prices
Model 2.
Retailer
:has_many prices
:has_one profile
Model 3.
Price – price:integer
:belongs_to :retailers
:belongs_to :products
Model 4.
Profile – Shippingcost:integer
:belongs_to :retailers
I want to be able to sort by(:price+:shippingCost), I know how to do this with SQL, with left joins and creating a “(bla + bla2) AS totalPrice and sort it by totalPrice, but is there a simpler way to do this?
So,ething like that. But it is too deep nested