Files
openfoodnetwork/app/serializers/api/enterprise_serializer.rb
Luis Ramos e52937c113 Use rubocop auto correct to add frozen string literal to all files
This is an unsafe auto corection, we will need to trust our build here
2021-06-17 23:07:26 +01:00

25 lines
644 B
Ruby

# frozen_string_literal: true
require 'open_food_network/property_merge'
class Api::EnterpriseSerializer < ActiveModel::Serializer
# We reference this here because otherwise the serializer complains about its absence
# rubocop:disable Lint/Void
Api::IdSerializer
# rubocop:enable Lint/Void
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