added Speaker#full_name to the JSON API

This commit is contained in:
Ancor Gonzalez Sosa
2013-07-22 11:54:27 +02:00
parent 0c20151de8
commit f905bb8f8f

View File

@@ -1,12 +1,16 @@
class SpeakerSerializer < ActiveModel::Serializer
include ActionView::Helpers::TextHelper
attributes :guid, :name, :company, :biography
attributes :guid, :name, :full_name, :company, :biography
def name
object.public_name
end
def full_name
[object.first_name, object.last_name].join(" ")
end
def biography
if object.biography.blank?
nil