Sha256: f5d2b6a0624f33aa25120595935f4e6107d524dab30b5ba015dc5c04d03687d4

Contents?: true

Size: 925 Bytes

Versions: 5

Compression:

Stored size: 925 Bytes

Contents

module Sitepress
  class Engine < ::Rails::Engine
    config.before_configuration do |app|
      Sitepress.configure do |config|
        app.paths["app/helpers"].push config.site.root_path.join("helpers")
        app.paths["app/assets"].push config.site.root_path.join("assets")
        app.paths["app/views"].push config.site.root_path
      end

      # Setup concerns paths for Rails 4 (doesn't automatically populate)
      concerns_path = "app/controllers/concerns"
      unless app.paths.keys.include?(concerns_path)
        app.paths.add(concerns_path)
      end
    end

    initializer "sitepress.configure" do |app|
      Sitepress.configure do |config|
        config.parent_engine = app
        config.cache_resources = app.config.cache_classes
      end
    end

    initializer "sitepress.middleware" do |app|
      app.middleware.use Sitepress::Middleware::RequestCache, site: Sitepress.site
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sitepress-rails-0.1.28 lib/sitepress/engine.rb
sitepress-rails-0.1.27 lib/sitepress/engine.rb
sitepress-rails-0.1.26 lib/sitepress/engine.rb
sitepress-rails-0.1.25 lib/sitepress/engine.rb
sitepress-rails-0.1.24 lib/sitepress/engine.rb