2013-07-08 10:07:12 +02:00
|
|
|
class SpeakerSerializer < ActiveModel::Serializer
|
|
|
|
|
include ActionView::Helpers::TextHelper
|
|
|
|
|
|
2014-06-23 19:07:50 +03:00
|
|
|
attributes :guid, :name, :affiliation, :biography
|
2013-07-08 10:07:12 +02:00
|
|
|
|
|
|
|
|
def name
|
2014-06-23 19:07:50 +03:00
|
|
|
object.name
|
2013-07-22 11:54:27 +02:00
|
|
|
end
|
|
|
|
|
|
2013-07-08 10:07:12 +02:00
|
|
|
def biography
|
|
|
|
|
if object.biography.blank?
|
|
|
|
|
nil
|
|
|
|
|
else
|
2014-06-24 12:14:53 +03:00
|
|
|
simple_format(object.biography).gsub('\n', '')
|
2013-07-08 10:07:12 +02:00
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|