Added colours for teams

This commit is contained in:
2025-04-24 07:04:42 +02:00
parent 777a33836d
commit aa2a8b9f26
6 changed files with 161 additions and 26 deletions

View File

@@ -0,0 +1,6 @@
class ReservationSerializer < ActiveModel::Serializer
attributes :id, :start_time, :end_time
belongs_to :customer
belongs_to :team, serializer: TeamSerializer
end

View File

@@ -0,0 +1,9 @@
class TeamSerializer < ActiveModel::Serializer
include ColorHelper
attributes :id, :name, :color
def color
team_color(object.id)
end
end