Sha256: 9869eb2339d09c658e7e6b0dcec87079f297f1a26b04c070349888053367497d

Contents?: true

Size: 1.32 KB

Versions: 14

Compression:

Stored size: 1.32 KB

Contents

require 'apartment'
require 'ims/lti'
require 'attr_encrypted'

module PandaPal
  class Engine < ::Rails::Engine
    config.autoload_once_paths += Dir["#{config.root}/lib/**/"]

    isolate_namespace PandaPal

    config.generators do |g|
      g.test_framework :rspec
      g.fixture_replacement :factory_girl, :dir => 'spec/factories'
    end

    initializer :append_migrations do |app|
      unless app.root.to_s.match root.to_s
        config.paths["db/migrate"].expanded.each do |expanded_path|
          app.config.paths["db/migrate"] << expanded_path
        end
        # Apartment will modify this, but it doesn't fully support engine migrations, so we'll reset it here
        ActiveRecord::Migrator.migrations_paths = Rails.application.paths['db/migrate'].to_a
      end
    end

    initializer 'panda_pal.app_controller' do |app|
      OAUTH_10_SUPPORT = true
      ActiveSupport.on_load(:action_controller) do
        include PandaPal::Helpers::ControllerHelper
      end
    end

    initializer 'panda_pal.route_helper' do |route|
      ActionDispatch::Routing::Mapper.send :include, PandaPal::Helpers::RouteHelper
    end

    initializer 'panda_pal.route_options' do |app|
      ActiveSupport.on_load(:action_controller) do
        Rails.application.reload_routes!
        PandaPal::propagate_lti_navigation
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
panda_pal-3.2.3 lib/panda_pal/engine.rb
panda_pal-3.2.2 lib/panda_pal/engine.rb
panda_pal-3.2.1 lib/panda_pal/engine.rb
panda_pal-3.2.0 lib/panda_pal/engine.rb
panda_pal-3.1.4 lib/panda_pal/engine.rb
panda_pal-3.1.3 lib/panda_pal/engine.rb
panda_pal-3.1.2 lib/panda_pal/engine.rb
panda_pal-3.1.1 lib/panda_pal/engine.rb
panda_pal-3.1.0 lib/panda_pal/engine.rb
panda_pal-3.0.6 lib/panda_pal/engine.rb
panda_pal-3.0.5 lib/panda_pal/engine.rb
panda_pal-3.0.4 lib/panda_pal/engine.rb
panda_pal-3.0.3 lib/panda_pal/engine.rb
panda_pal-3.0.1 lib/panda_pal/engine.rb