Sha256: 90bc9cc0cb18b67479a7037426a666444d537f69d847e451cc1c92315b3d6dff

Contents?: true

Size: 1.5 KB

Versions: 7

Compression:

Stored size: 1.5 KB

Contents

module PushType
  module Auth
    class Engine < ::Rails::Engine
      isolate_namespace PushType
      engine_name 'push_type_auth'

      config.generators do |g|
        g.assets false
        g.helper false
        g.test_framework  :test_unit, fixture: false
      end

      config.to_prepare do
        # Make User authenticatable
        PushType::User.include PushType::Authenticatable
        
        # Extend controllers with auth/invitation methos
        PushType::AdminController.include PushType::AuthenticationMethods
        PushType::UsersController.include PushType::InvitationMethods
        
        # Configure devise with helpers and layout
        DeviseController.helper PushType::AdminHelper
        Devise::Mailer.layout 'push_type/email'
      end

      initializer 'push_type_auth.devise_config' do
        Devise.mailer_sender = PushType.config.mailer_sender
        Devise.router_name = :push_type
      end

      initializer 'push_type.auth_assets' do
        ActiveSupport.on_load :push_type_admin do
          admin_assets.javascripts << 'push_type/auth'
        end
      end

      initializer 'push_type_auth.menus' do
        PushType.menu :utility do
          item :settings do
            text  { ficon(:widget) }
            link  { push_type.edit_profile_path }
          end
          item :sign_out do
            text  { ficon(:power) }
            link  { push_type.destroy_user_session_path }
            link_options method: 'delete'
          end
        end
      end

    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
push_type_auth-0.9.0.beta.2 lib/push_type/auth/engine.rb
push_type_auth-0.8.2 lib/push_type/auth/engine.rb
push_type_auth-0.8.1 lib/push_type/auth/engine.rb
push_type_auth-0.8.0 lib/push_type/auth/engine.rb
push_type_auth-0.8.0.beta.3 lib/push_type/auth/engine.rb
push_type_auth-0.8.0.beta.2 lib/push_type/auth/engine.rb
push_type_auth-0.8.0.beta.1 lib/push_type/auth/engine.rb