wedding-planner/app/serializers/serializable_guest.rb

20 lines
355 B
Ruby
Raw Normal View History

2024-10-27 21:42:45 +00:00
# Copyright (C) 2024 Manuel Bustillo
class SerializableGuest < JSONAPI::Serializable::Resource
type 'guest'
2024-08-11 19:24:24 +02:00
attributes :id, :email, :group_id, :status
attribute :name do
"#{@object.first_name} #{@object.last_name}"
end
attribute :group_name do
@object.group.name
end
2024-08-11 19:24:24 +02:00
attribute :status do
@object.status.capitalize
end
end