Created
December 12, 2017 20:33
-
-
Save manlycode/0275c66c0ced7b79f85d32aba422b6fd to your computer and use it in GitHub Desktop.
This file contains 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
statement_join = customer | |
.statements | |
.joins("LEFT JOIN buildings_users ON buildings_users.building_id = statements.building_id") | |
.where(id: statements.map(&:id)) | |
.where(buildings_users: { receive_reports: true }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment