Absolute value in AREL (rails)
I need to do some absolute values in AREL. Basically you need to understand how to execute this line (in relational algebra) with ARel:
Suppose P is a table with columns value1 and value2:
Project((|p.value1 - 10| + |p.value2 - 10|) as match) P
Not sure if this is possible with AREL.
Thanks in advance!
source to share