Sha256: 7d70356cf693402e0c3e7f39547b39785780c39704a8f18251915242fa289f3c

Contents?: true

Size: 790 Bytes

Versions: 12

Compression:

Stored size: 790 Bytes

Contents

class Admin::BaseController < ActionController::Base

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

  before_filter :set_models_constantized
  before_filter :reload_config_and_roles
  before_filter :authenticate
  before_filter :set_locale

  helper_method :admin_user

  def user_guide
  end

  protected

  def set_models_constantized
    Typus::Configuration.models_constantized!
  end

  def reload_config_and_roles
    Typus.reload! unless Rails.env.production?
  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

12 entries across 12 versions & 1 rubygems

Version Path
typus-3.1.0.rc12 app/controllers/admin/base_controller.rb
typus-3.1.0.rc11 app/controllers/admin/base_controller.rb
typus-3.1.0.rc10 app/controllers/admin/base_controller.rb
typus-3.1.0.rc9 app/controllers/admin/base_controller.rb
typus-3.1.0.rc8 app/controllers/admin/base_controller.rb
typus-3.1.0.rc7 app/controllers/admin/base_controller.rb
typus-3.1.0.rc6 app/controllers/admin/base_controller.rb
typus-3.1.0.rc5 app/controllers/admin/base_controller.rb
typus-3.1.0.rc4 app/controllers/admin/base_controller.rb
typus-3.1.0.rc3 app/controllers/admin/base_controller.rb
typus-3.1.0.rc2 app/controllers/admin/base_controller.rb
typus-3.1.0.rc1 app/controllers/admin/base_controller.rb