From 59cec711516323f4045c81dee844ce2c7f6e09d2 Mon Sep 17 00:00:00 2001 From: Petko Bordjukov Date: Tue, 4 Oct 2016 14:18:23 +0300 Subject: [PATCH] Limit conflict calcluation to this year's preferences --- app/models/conflict_coefficient.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/conflict_coefficient.rb b/app/models/conflict_coefficient.rb index 949e42f..d76efac 100644 --- a/app/models/conflict_coefficient.rb +++ b/app/models/conflict_coefficient.rb @@ -3,8 +3,8 @@ class ConflictCoefficient def self.all talk_combinations = Talk.find(:all, from: :halfnarp_friendly).map(&:id).combination(2) - talk_preferences = TalkPreference.all - talk_preferences_count = TalkPreference.count + talk_preferences = TalkPreference.this_years + talk_preferences_count = talk_preferences.count talk_combinations.map do |talks| conflicts = talk_preferences.select do |talk_preference|