Sha256: d9069e6cb51f4fd57af36cb00715b0922a3b7ce9df862ce6e66f7ce57c966b91
Contents?: true
Size: 883 Bytes
Versions: 22
Compression:
Stored size: 883 Bytes
Contents
module Plutonium module Core module Autodiscovery module InputDiscoverer extend ActiveSupport::Concern include Discoverer class_methods do def autodiscovery_input_cache = @autodiscovery_input_cache ||= {} end private # If cache_discovery is enabled, use the class level cache that persists # between requests, otherwise use the instance one. def autodiscovery_input_cache if Rails.application.config.plutonium.cache_discovery self.class.autodiscovery_input_cache else @autodiscovery_input_cache ||= {} end end def autodiscover_input(name) autodiscovery_input_cache[name] ||= Plutonium::Core::Fields::Inputs::Factory.for_resource_attribute(resource_class, name) end end end end end
Version data entries
22 entries across 22 versions & 1 rubygems