mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-16 21:24:05 +00:00
15 lines
299 B
Ruby
15 lines
299 B
Ruby
|
|
class EventScheduleSerializer < ActiveModel::Serializer
|
||
|
|
include ActionView::Helpers::TextHelper
|
||
|
|
|
||
|
|
attributes :date, :room
|
||
|
|
|
||
|
|
def date
|
||
|
|
t = object.start_time
|
||
|
|
t.blank? ? '' : %( #{I18n.l t, format: :short}#{t.formatted_offset(false)} )
|
||
|
|
end
|
||
|
|
|
||
|
|
def room
|
||
|
|
object.room.try(:guid)
|
||
|
|
end
|
||
|
|
end
|