2018-05-07 16:47:29 -07:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
2021-02-20 09:57:27 -08:00
|
|
|
# == Schema Information
|
|
|
|
|
#
|
|
|
|
|
# Table name: event_schedules
|
|
|
|
|
#
|
|
|
|
|
# id :bigint not null, primary key
|
|
|
|
|
# enabled :boolean default(TRUE)
|
|
|
|
|
# start_time :datetime
|
|
|
|
|
# created_at :datetime not null
|
|
|
|
|
# updated_at :datetime not null
|
|
|
|
|
# event_id :integer
|
|
|
|
|
# room_id :integer
|
|
|
|
|
# schedule_id :integer
|
|
|
|
|
#
|
|
|
|
|
# Indexes
|
|
|
|
|
#
|
|
|
|
|
# index_event_schedules_on_event_id (event_id)
|
|
|
|
|
# index_event_schedules_on_event_id_and_schedule_id (event_id,schedule_id) UNIQUE
|
|
|
|
|
# index_event_schedules_on_room_id (room_id)
|
|
|
|
|
# index_event_schedules_on_schedule_id (schedule_id)
|
|
|
|
|
#
|
2016-07-08 13:28:02 +02:00
|
|
|
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
|
2016-07-26 16:20:31 +02:00
|
|
|
object.room.guid
|
2016-07-08 13:28:02 +02:00
|
|
|
end
|
|
|
|
|
end
|