Last active
April 25, 2017 15:53
-
-
Save joemsak/5908f3d336306e8125ef142260046912 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
@events = RegionalPitchEvent.in_region_of(current_ambassador) | |
.joins(:divisions, :judges, teams: { team_submissions: :submission_scores }) | |
@event.teams.order("teams.name") # OKAY | |
@event.teams.order("LOWER(teams.name)") # NOT OKAY | |
#PG::InvalidColumnReference: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list | |
#LINE 1: ..._event_id" = $1 AND (divisions.name = 0) ORDER BY LOWER(team... | |
^ | |
#: SELECT DISTINCT "teams".* FROM "teams" INNER JOIN "divisions" ON "divisions"."id" = "teams"."division_id" | |
# INNER JOIN "regional_pitch_events_teams" ON "teams"."id" = "regional_pitch_events_teams"."team_id" | |
# WHERE "regional_pitch_events_teams"."regional_pitch_event_id" = $1 AND (divisions.name = 0) | |
# ORDER BY LOWER(teams.name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment