Sha256: ecedb9d1f1b6c3bc47ff503d1e6dd3b54e862efc53aca1b6ee59c6d7366c2ff3

Contents?: true

Size: 1.31 KB

Versions: 3

Compression:

Stored size: 1.31 KB

Contents

module Refinery
  module Authentication
    module Devise
      class Engine < ::Rails::Engine
        include Refinery::Engine

        isolate_namespace Refinery::Authentication::Devise
        engine_name :refinery_authentication

        config.autoload_paths += %W( #{config.root}/lib )

        before_inclusion do
          Refinery::Plugin.register do |plugin|
            plugin.pathname = root
            plugin.name = 'refinery_authentication_devise'
            plugin.menu_match = %r{refinery/(authentication/devise/)?users$}
            plugin.url = proc {
              Refinery::Core::Engine.routes.url_helpers.authentication_devise_admin_users_path
            }
          end
        end

        before_inclusion do
          [Refinery::AdminController, ::ApplicationController].each do |c|
            Refinery.include_once(c, Refinery::Authentication::Devise::System)
          end
        end

        config.before_configuration do
          require 'refinery/authentication/devise/initialiser'
        end

        config.after_initialize do
          Refinery.register_extension(Refinery::Authentication::Devise)

          Rails.application.reload_routes!
          Refinery::Core.refinery_logout_path =
            Refinery::Core::Engine.routes.url_helpers.logout_path
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
refinerycms-authentication-devise-1.0.2 lib/refinery/authentication/devise/engine.rb
refinerycms-authentication-devise-1.0.1 lib/refinery/authentication/devise/engine.rb
refinerycms-authentication-devise-1.0.0 lib/refinery/authentication/devise/engine.rb