osem-fcy/app/serializers/event_schedule_serializer.rb
Andrew Kvalheim 397341a324 Use JSON date serializer
Effective API changes:

  - nil serializes to null, not empty string
  - dates serialize to IETF RFC 3339 with millisecond precision, not
    second precision surrounded by spaces
2022-09-28 09:34:01 -07:00

12 lines
228 B
Ruby

# frozen_string_literal: true
class EventScheduleSerializer < ActiveModel::Serializer
include ActionView::Helpers::TextHelper
attribute :start_time, key: :date
attributes :room
def room
object.room.guid
end
end