Created
July 27, 2015 23:26
-
-
Save oddlyfunctional/c8f2ea5558db18ced676 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sql = 'user_id = ? OR (client_id IN (?) AND (category_id IS NULL AND category_id IN (?) OR scenario_id IS NULL AND scenario_id IN (?)))' | |
Submission.where(sql, current_user.id, current_user.client_ids, current_user.categories.pluck(:id), current_user.scenarios.pluck(:id)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment