mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
21 lines
554 B
Ruby
21 lines
554 B
Ruby
require 'open_food_network/property_merge'
|
|
|
|
class Api::EnterpriseSerializer < ActiveModel::Serializer
|
|
# We reference this here because otherwise the serializer complains about its absence
|
|
Api::IdSerializer
|
|
|
|
def serializable_hash
|
|
cached_serializer_hash.merge uncached_serializer_hash
|
|
end
|
|
|
|
private
|
|
|
|
def cached_serializer_hash
|
|
Api::CachedEnterpriseSerializer.new(object, @options).serializable_hash || {}
|
|
end
|
|
|
|
def uncached_serializer_hash
|
|
Api::UncachedEnterpriseSerializer.new(object, @options).serializable_hash || {}
|
|
end
|
|
end
|