added Speaker#full_name to the JSON API
This commit is contained in:
parent
0c20151de8
commit
f905bb8f8f
1 changed files with 5 additions and 1 deletions
|
|
@ -1,12 +1,16 @@
|
||||||
class SpeakerSerializer < ActiveModel::Serializer
|
class SpeakerSerializer < ActiveModel::Serializer
|
||||||
include ActionView::Helpers::TextHelper
|
include ActionView::Helpers::TextHelper
|
||||||
|
|
||||||
attributes :guid, :name, :company, :biography
|
attributes :guid, :name, :full_name, :company, :biography
|
||||||
|
|
||||||
def name
|
def name
|
||||||
object.public_name
|
object.public_name
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def full_name
|
||||||
|
[object.first_name, object.last_name].join(" ")
|
||||||
|
end
|
||||||
|
|
||||||
def biography
|
def biography
|
||||||
if object.biography.blank?
|
if object.biography.blank?
|
||||||
nil
|
nil
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue