Merge pull request #847 from WanWizard/feature/ar_parentheses

added query grouping to Active Record