I am using Ruby on Rails 3.2.2 and I would like to generate the following SQL query:
SELECT `articles`.* FROM `articles` WHERE (`articles`.`user_id` = 1 OR `
I had the same problem. I was searching the web for some hours and finally found a method named grouping in Arel::FactoryMethods which simply adds brackets around an expression.
You should wrap your groups with a arel_table.grouping(...) call.
arel_table.grouping(...)