Limit conflict calcluation to this year's preferences

This commit is contained in:
Petko Bordjukov 2016-10-04 14:18:23 +03:00
parent 5e83ea8b3c
commit 59cec71151
1 changed files with 2 additions and 2 deletions

View File

@ -3,8 +3,8 @@ class ConflictCoefficient
def self.all def self.all
talk_combinations = Talk.find(:all, from: :halfnarp_friendly).map(&:id).combination(2) talk_combinations = Talk.find(:all, from: :halfnarp_friendly).map(&:id).combination(2)
talk_preferences = TalkPreference.all talk_preferences = TalkPreference.this_years
talk_preferences_count = TalkPreference.count talk_preferences_count = talk_preferences.count
talk_combinations.map do |talks| talk_combinations.map do |talks|
conflicts = talk_preferences.select do |talk_preference| conflicts = talk_preferences.select do |talk_preference|