module Ettu
  class Railtie < Rails::Railtie
    initializer 'install' do
      require 'ettu'

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

module Ettu
  class Railtie < Rails::Railtie
    config.ettu = ActiveSupport::OrderedOptions.new

    initializer 'load' do |app|

      unless app.config.ettu.disabled
        require 'ettu'
        ActiveSupport.on_load :action_controller do
          ActionController::Base.send :include, FreshWhen
        end

        if app.config.ettu.development_hack
          class BlackHole < Hash
            def []=(k, v); end
          end
          module ::ActionView
            class Digestor
              @@cache = BlackHole.new
            end
          end
        end

      end
    end
  end
end

Allow Ettu to be configured
Allow Ettu to be configured

Allows Ettu to be disabled using the standard rails config optoins, and
adds in a flag to workaround
[#10791](https://github.com/rails/rails/pull/10791).
