speakers_names is made in sentense using join

This commit is contained in:
Your Name 2017-10-17 20:54:53 +05:30 committed by Naman Gupta
parent 52a5cb2391
commit 6c8ebe586c

View file

@ -204,11 +204,7 @@ class Event < ActiveRecord::Base
end
def speaker_names
result = Set.new
speakers.each do |speaker|
result.add(speaker.name)
end
result.to_a.to_sentence
speakers.map(&:name).join(', ')
end
# Returns emails of all the speaker belongs to a particular event