Created
January 6, 2015 03:20
-
-
Save aquajach/64c1a772a99007284535 to your computer and use it in GitHub Desktop.
Exception in production
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
| ActiveRecord::StatementInvalid (PG::SyntaxError: ERROR: syntax error at or near ")" | |
| LINE 20: ...(CASE WHEN lower(partners_languages.language) IN () THEN 1 E... | |
| ^ | |
| : | |
| SELECT users.id FROM ( | |
| SELECT users.id, (CASE WHEN lower(users.my_sector) = lower('Real Estate') THEN users.score + 2 ELSE users.score END) AS score | |
| FROM ( | |
| SELECT users.id, users.my_sector, SUM(location) AS score | |
| FROM ( | |
| SELECT | |
| users.id, | |
| users.my_sector, | |
| (CASE WHEN lower(partners_locations.location) LIKE '%%' THEN users.score + 1 ELSE score END) AS location | |
| FROM ( | |
| SELECT | |
| users.id, | |
| users.my_sector, | |
| SUM(language) AS score | |
| FROM ( | |
| SELECT | |
| users.id, | |
| users.my_sector, | |
| (CASE WHEN lower(partners_languages.language) IN () THEN 1 ELSE 0 END) AS language | |
| FROM users | |
| LEFT JOIN partners_languages ON users.id = partners_languages.user_id | |
| WHERE users.profile_image_file_name IS NOT NULL | |
| ) AS users | |
| GROUP BY users.id, users.my_sector | |
| ) AS users | |
| LEFT JOIN partners_locations ON users.id = partners_locations.user_id | |
| ) AS users | |
| GROUP BY users.id, users.my_sector | |
| ) AS users | |
| ) AS users | |
| WHERE users.score > 1 | |
| ORDER BY users.score DESC | |
| ): | |
| app/models/user.rb:69:in `recommended_users' | |
| app/controllers/application_controller.rb:76:in `set_recommended_users' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment