arel
A SQL algebra for #ruby.
A SQL algebra for #ruby.
In my case I have a model Product has_one Location
The Location have a scope :near, lambda(coordinate, distance) { #... }.
I want to use near scope in this query:
Product.where(...).joins(:location)