Sha256: 0bae679f35a887e389268aa352b1e34ca98e63ca72d1b7a31046e71b3023fc82

Contents?: true

Size: 908 Bytes

Versions: 1

Compression:

Stored size: 908 Bytes

Contents

module Revelry::Content
  class Engine < ::Rails::Engine
    engine_name 'revelry_content'
    isolate_namespace Revelry::Content

    initializer 'revelry.content_autoload_path', before: :set_autoload_paths do
      config.autoload_paths << File.expand_path('../../', __FILE__)
    end

    CONFIG_ASSET = 'revelry_content/config'

    # Require the route config to load before we load the config (we need route
    # helpers to generate that file)
    initializer 'revelry.content_depend_on_routes', after: "sprockets.environment" do
      if Rails.application.assets.respond_to?(:register_preprocessor)
        routes = Rails.root.join('config','routes.rb')
        Rails.application.assets.register_preprocessor 'application/javascript', :'revelry.content_depend_on_routes' do |ctx,data|
          require routes if ctx.logical_path == CONFIG_ASSET
          data
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
revelry_content-1.0.0 lib/revelry/content/engine.rb