Closed fdutey closed 3 years ago
Adding this gem breaks ActiveRelation or method. Scopes are evaluated too early
or
Example
table = Model.arel_table col_a = table[:col_a] col_b = table[:col_b] Model.where( col_a.eq(1) ).or( Model.where( col_b.eq(1) ) )
Before: the request is triggered after the or (so SQL is col_a = 1 OR col_b = 1) Now: the request is triggered before the or (so SQL is col_a = 1)
col_a = 1 OR col_b = 1
col_a = 1
Hi Florian, Thanks for your contribution. The gem 2.0.22 should fix this issue.
Works like a charm.
Thank you so much! ;)
Adding this gem breaks ActiveRelation
or
method. Scopes are evaluated too earlyExample
Before: the request is triggered after the or (so SQL is
col_a = 1 OR col_b = 1
) Now: the request is triggered before the or (so SQL iscol_a = 1
)