mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-11 18:26:50 +00:00
18 lines
371 B
Ruby
18 lines
371 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Api
|
|
class UncachedEnterpriseSerializer < ActiveModel::Serializer
|
|
include SerializerHelper
|
|
|
|
attributes :orders_close_at, :active
|
|
|
|
def orders_close_at
|
|
options[:data].earliest_closing_times[object.id]&.to_time
|
|
end
|
|
|
|
def active
|
|
options[:data].active_distributor_ids&.include? object.id
|
|
end
|
|
end
|
|
end
|