2013-07-04 14:02:50 +02:00
|
|
|
class ConferenceSerializer < ActiveModel::Serializer
|
2013-07-08 10:07:12 +02:00
|
|
|
attributes :guid, :name, :description, :year, :socialtag, :date_range, :url, :revision
|
2013-07-04 14:02:50 +02:00
|
|
|
|
|
|
|
|
def name
|
|
|
|
|
object.title
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def year
|
|
|
|
|
object.start_date.try(:year)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def socialtag
|
2014-07-31 20:09:38 +02:00
|
|
|
object.contact.social_tag
|
2013-07-04 14:02:50 +02:00
|
|
|
end
|
|
|
|
|
|
2013-07-08 10:07:12 +02:00
|
|
|
def revision
|
|
|
|
|
object.revision || 0
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# FIXME: adjusting the format the DIRTY way, for oSC13.
|
|
|
|
|
# If you think this is ugly, don't look at the methods below
|
2013-07-04 14:02:50 +02:00
|
|
|
def date_range
|
2014-06-24 12:14:53 +03:00
|
|
|
object.date_range_string.try(:split, ',').try(:first)
|
2013-07-08 10:07:12 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# FIXME: just giving suseconferenceclient something to play with
|
|
|
|
|
def description
|
2014-06-24 12:14:53 +03:00
|
|
|
'openSUSE Conference 2013 - Power to the Geeko'
|
2013-07-08 10:07:12 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# FIXME: same than the former
|
|
|
|
|
def url
|
2014-06-24 12:14:53 +03:00
|
|
|
'https://conference.opensuse.org/'
|
2013-07-04 14:02:50 +02:00
|
|
|
end
|
|
|
|
|
end
|