From eff79dab6391a7c6284b27429688857309526c07 Mon Sep 17 00:00:00 2001 From: Petko Bordjukov Date: Thu, 6 Oct 2016 23:09:53 +0300 Subject: [PATCH] Fix syntax errors in the conflict coefficient --- app/models/conflict_coefficient.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/models/conflict_coefficient.rb b/app/models/conflict_coefficient.rb index 0245e2a..682786b 100644 --- a/app/models/conflict_coefficient.rb +++ b/app/models/conflict_coefficient.rb @@ -19,11 +19,10 @@ class ConflictCoefficient end def conflicts - talk_preferences.joins('INNER JOIN "selected_talks" AS left + talk_preferences.joins('INNER JOIN "selected_talks" AS "left" ON "left"."talk_preference_id" = "talk_preferences"."unique_id" - 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 + 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 def total_votes