gauge/app/models/conflicts_summary.rb

19 lines
350 B
Ruby
Raw Normal View History

2016-10-12 21:51:36 +03:00
class ConflictsSummary
include ActiveModel::Model
attr_accessor :talk_ids
def talk_ids
@talk_ids ||= []
end
def conflicts
talk_ids.map do |talk_id|
{
talk_id: talk_id,
conflicts: ConflictsTable.new(talk_id: talk_id, other_talks_ids: talk_ids.reject { |id| id == talk_id }).conflicts
}
end
end
end