Files
openfoodnetwork/app/serializers/api/uncached_enterprise_serializer.rb
Matt-Yorkley 1d5077061e Remove andand
This old gem implemented some functionality for handling nils which is no longer needed, as it's provided natively by Ruby with the &. operator.
2021-09-08 14:28:31 +01:00

18 lines
362 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]
end
def active
options[:data].active_distributor_ids&.include? object.id
end
end
end