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

Version Path
plutonium-0.16.5 lib/plutonium/core/autodiscovery/association_renderer_discoverer.rb
plutonium-0.16.4 lib/plutonium/core/autodiscovery/association_renderer_discoverer.rb
plutonium-0.16.3 lib/plutonium/core/autodiscovery/association_renderer_discoverer.rb
plutonium-0.16.1 lib/plutonium/core/autodiscovery/association_renderer_discoverer.rb
plutonium-0.16.0 lib/plutonium/core/autodiscovery/association_renderer_discoverer.rb
plutonium-0.15.24 lib/plutonium/core/autodiscovery/association_renderer_discoverer.rb
plutonium-0.15.23 lib/plutonium/core/autodiscovery/association_renderer_discoverer.rb
plutonium-0.15.22 lib/plutonium/core/autodiscovery/association_renderer_discoverer.rb
plutonium-0.15.21 lib/plutonium/core/autodiscovery/association_renderer_discoverer.rb
plutonium-0.15.20 lib/plutonium/core/autodiscovery/association_renderer_discoverer.rb
plutonium-0.15.19 lib/plutonium/core/autodiscovery/association_renderer_discoverer.rb
plutonium-0.15.18 lib/plutonium/core/autodiscovery/association_renderer_discoverer.rb
plutonium-0.15.17 lib/plutonium/core/autodiscovery/association_renderer_discoverer.rb
plutonium-0.15.16 lib/plutonium/core/autodiscovery/association_renderer_discoverer.rb
plutonium-0.15.15 lib/plutonium/core/autodiscovery/association_renderer_discoverer.rb
plutonium-0.15.14 lib/plutonium/core/autodiscovery/association_renderer_discoverer.rb
plutonium-0.15.13 lib/plutonium/core/autodiscovery/association_renderer_discoverer.rb
plutonium-0.15.12 lib/plutonium/core/autodiscovery/association_renderer_discoverer.rb
plutonium-0.15.11 lib/plutonium/core/autodiscovery/association_renderer_discoverer.rb
plutonium-0.15.10 lib/plutonium/core/autodiscovery/association_renderer_discoverer.rb