From 9d305834e3d17319a3bfe043958bbc0daf51d70d Mon Sep 17 00:00:00 2001 From: Petko Bordjukov Date: Wed, 12 Oct 2016 21:57:30 +0300 Subject: [PATCH] Fix a syntax error in the conflict counting SQL --- app/models/conflicts.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/conflicts.rb b/app/models/conflicts.rb index ce729b8..0af18f8 100644 --- a/app/models/conflicts.rb +++ b/app/models/conflicts.rb @@ -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