mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
16 lines
376 B
Ruby
16 lines
376 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Api
|
|
module Admin
|
|
class ScheduleSerializer < ActiveModel::Serializer
|
|
attributes :id, :name, :order_cycle_ids, :viewing_as_coordinator
|
|
|
|
has_many :order_cycles, serializer: Api::Admin::IdNameSerializer
|
|
|
|
def viewing_as_coordinator
|
|
options[:editable_schedule_ids].include? object.id
|
|
end
|
|
end
|
|
end
|
|
end
|