Fix a syntax error in the conflict counting SQL

This commit is contained in:
Petko Bordjukov 2016-10-12 21:57:30 +03:00
parent 37a414328f
commit 9d305834e3
1 changed files with 2 additions and 2 deletions

View File

@ -4,9 +4,9 @@ class Conflicts
attr_accessor :left, :right
def conflicts
TalkPreference.joins('INNER JOIN "selected_talks" AS left
TalkPreference.joins('INNER JOIN "selected_talks" AS "left"
ON "left"."talk_preference_id" = "talk_preferences"."unique_id"
INNER JOIN "selected_talks" AS right
INNER JOIN "selected_talks" AS "right"
ON "right"."talk_preference_id" = "talk_preferences"."unique_id"').where(left: {talk_id: @left}, right: {talk_id: @right}).count
end
end