Sha256: e5efc2326a16e3d617a445b54a9d1d183a380905d3db09ad0a9a978698046579

Contents?: true

Size: 737 Bytes

Versions: 1

Compression:

Stored size: 737 Bytes

Contents

module CacheDigests
  class Engine < ::Rails::Engine
    initializer 'cache_digests' do |app|
      require 'cache_digests'

      ActiveSupport.on_load :action_view do
        ActionView::Base.send :include, CacheDigests::FragmentHelper
        unless ActionView::Base.cache_template_loading
          CacheDigests::TemplateDigestor.cache = ActiveSupport::Cache::NullStore.new
        end
      end

      ActiveSupport.on_load :action_controller do
        ActionController::Base.send :include, CacheDigests::ViewCacheDependency
      end

      config.to_prepare do
        CacheDigests::TemplateDigestor.logger = Rails.logger
        DependencyTracker.register_tracker :erb, DependencyTracker::ERBTracker
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cache_digests-0.3.1 ./lib/cache_digests/engine.rb