2013-07-08 10:07:12 +02:00
|
|
|
class SpeakerSerializer < ActiveModel::Serializer
|
|
|
|
|
include ActionView::Helpers::TextHelper
|
|
|
|
|
|
2013-07-22 11:54:27 +02:00
|
|
|
attributes :guid, :name, :full_name, :company, :biography
|
2013-07-08 10:07:12 +02:00
|
|
|
|
|
|
|
|
def name
|
|
|
|
|
object.public_name
|
|
|
|
|
end
|
|
|
|
|
|
2013-07-22 11:54:27 +02:00
|
|
|
def full_name
|
|
|
|
|
[object.first_name, object.last_name].join(" ")
|
|
|
|
|
end
|
|
|
|
|
|
2013-07-08 10:07:12 +02:00
|
|
|
def biography
|
|
|
|
|
if object.biography.blank?
|
|
|
|
|
nil
|
|
|
|
|
else
|
|
|
|
|
simple_format(object.biography).gsub("\n", "")
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|