[feat]Implement FullCalendar#rooms_to_resources and add tests

This commit is contained in:
Jimmy 2021-04-26 09:48:16 +08:00 committed by CactusPuppy
parent 40916b6a36
commit abe2ea9bb3
No known key found for this signature in database
GPG key ID: 4B33B0A3E15E2C82
4 changed files with 59 additions and 29 deletions

View file

@ -1,3 +1,16 @@
class FullCalendarFormatter
def rooms_to_resources(rooms); end
def self.rooms_to_resources(rooms)
rooms.map { |room| room_to_resource(room) }.to_json
end
def self.event_schedules_to_resources(event_schedules); end
private_class_method
def self.room_to_resource(room)
{
id: room.guid,
title: room.name
}
end
end