Sha256: 1ac21b51aaa33df2f1fc7b6435946a7e944c404580bb1595935b93f217bbad5b

Contents?: true

Size: 985 Bytes

Versions: 3

Compression:

Stored size: 985 Bytes

Contents

# frozen_string_literal: true

require 'beyond_canvas/rails/routes'

module BeyondCanvas
  class Engine < ::Rails::Engine # :nodoc:
    isolate_namespace BeyondCanvas

    initializer 'beyond_canvas.assets.precompile' do |app|
      BeyondCanvas.configuration.stylesheets.each do |path, _|
        app.config.assets.precompile << path
      end
      BeyondCanvas.configuration.javascripts.each do |path|
        app.config.assets.precompile << path
      end
    end

    config.before_initialize do
      ActiveSupport.on_load :action_controller do
        include ::BeyondCanvas::Authentication
        include ::BeyondCanvas::LocaleManagement
        include ::BeyondCanvas::ResourceManagement
        include ::BeyondCanvas::RequestValidation
        include ::BeyondCanvas::StatusCodes

        ::ActionController::Base.helper BeyondCanvas::Engine.helpers
      end

      ActiveSupport.on_load :action_mailer do
        layout 'beyond_canvas/mailer'
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
beyond_canvas-0.16.2.pre lib/beyond_canvas/engine.rb
beyond_canvas-0.16.1.pre lib/beyond_canvas/engine.rb
beyond_canvas-0.16.0.pre lib/beyond_canvas/engine.rb