Sha256: e6f6108f82929986b571d1e9b1ac98d244b7e9b3b3a8ec881c7e6bb14f914cc7
Contents?: true
Size: 1002 Bytes
Versions: 34
Compression:
Stored size: 1002 Bytes
Contents
module Plutonium module Core module Autodiscovery module AssociationRendererDiscoverer extend ActiveSupport::Concern include Discoverer class_methods do def autodiscovery_association_renderer_cache = @autodiscovery_association_renderer_cache ||= {} end private # If cache_discovery is enabled, use the class level cache that persists # between requests, otherwise use the instance one. def autodiscovery_association_renderer_cache if Plutonium.configuration.cache_discovery self.class.autodiscovery_association_renderer_cache else @autodiscovery_association_renderer_cache ||= {} end end def autodiscover_association_renderer(name) autodiscovery_association_renderer_cache[name] ||= Plutonium::Core::Associations::Renderers::Factory.for_resource_association(resource_class, name) end end end end end
Version data entries
34 entries across 34 versions & 1 rubygems