Sha256: 7cfe6ab3485df650bb7893e19c0d4a3eccba238e4bee611aa6c1b128dcb1361f

Contents?: true

Size: 663 Bytes

Versions: 6

Compression:

Stored size: 663 Bytes

Contents

class Admin::BaseController < ActionController::Base

  include Typus::Authentication::const_get(Typus.authentication.to_s.classify)

  before_filter :reload_config_and_roles
  before_filter :authenticate
  before_filter :set_locale

  helper_method :admin_user

  def user_guide
  end

  protected

  def reload_config_and_roles
    Typus.reload! if Rails.env.development?
  end

  def set_locale
    I18n.locale = if admin_user && admin_user.respond_to?(:locale)
                    admin_user.locale
                  else
                    Typus::I18n.default_locale
                  end
  end

  def zero_users
    Typus.user_class.count.zero?
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
typus-3.1.0.rc18 app/controllers/admin/base_controller.rb
typus-3.1.0.rc17 app/controllers/admin/base_controller.rb
typus-3.1.0.rc16 app/controllers/admin/base_controller.rb
typus-3.1.0.rc15 app/controllers/admin/base_controller.rb
typus-3.1.0.rc14 app/controllers/admin/base_controller.rb
typus-3.1.0.rc13 app/controllers/admin/base_controller.rb