From 698dd349dc2b46595fb2fcd242b5a3978b13404c Mon Sep 17 00:00:00 2001 From: Petko Bordjukov Date: Wed, 5 Nov 2014 11:48:25 +0200 Subject: [PATCH] Remove the SuggestionGroup model --- app/models/suggestion_group.rb | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 app/models/suggestion_group.rb diff --git a/app/models/suggestion_group.rb b/app/models/suggestion_group.rb deleted file mode 100644 index 3f35d40..0000000 --- a/app/models/suggestion_group.rb +++ /dev/null @@ -1,14 +0,0 @@ -class SuggestionGroup - include ActiveModel::Model - attr_accessor :speaker, :suggestions - - def self.where(conditions = {}) - Event.joins(:track).includes(:user).where(conditions).group_by(&:user).map do |speaker, suggestions| - SuggestionGroup.new speaker: speaker, suggestions: suggestions - end.sort_by { |group| group.speaker.name } - end - - def self.for_conference(conference, conditions = {}) - where conditions.merge({tracks: {conference_id: conference.id}}) - end -end