Sha256: 065a1d0da8ab2d1fa7ccef013f0d6a5005873a6d66c0a9027eca8fe117a8e9dd

Contents?: true

Size: 710 Bytes

Versions: 4

Compression:

Stored size: 710 Bytes

Contents

require 'rails/railtie'

module Oprah
  class Railtie < Rails::Railtie
    initializer "oprah.configure_cache_clear_on_code_reload" do
      ActiveSupport::Reloader.to_run do
        Oprah::Presenter.cache.clear

        if Oprah.debug?
          Rails.logger.debug "Oprah cache cleared"
        end
      end
    end

    initializer "oprah.configure_action_controller_helpers" do
      ActiveSupport.on_load :action_controller do
        ActionController::Base.include(Oprah::ControllerHelpers)
      end
    end

    initializer "oprah.configure_action_mailer_helpers" do
      ActiveSupport.on_load :action_mailer do
        ActionMailer::Base.include(Oprah::ControllerHelpers)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
detaso-oprah-0.3.1 lib/oprah/railtie.rb
detaso-oprah-0.3.0 lib/oprah/railtie.rb
oprah-0.3.0 lib/oprah/railtie.rb
oprah-0.2.1 lib/oprah/railtie.rb