gauge/app/models/conflicts_table.rb

19 lines
341 B
Ruby
Raw Normal View History

2016-10-12 20:07:57 +03:00
class ConflictsTable
include ActiveModel::Model
attr_accessor :talk_id, :other_talks_ids
def other_talks_ids
@other_talks_ids ||= []
end
def conflicts
other_talks_ids.map do |right|
{
talk_id: right,
number_of_conflicts: Conflicts.new(left: talk_id, right: right).conflicts
}
end
end
end