Sha256: cc8f70102622811dfda76527336350efd0b256f45c3a878687ef0f3e6e324734

Contents?: true

Size: 686 Bytes

Versions: 7

Compression:

Stored size: 686 Bytes

Contents

class Admin::BaseController < ActionController::Base

  render_inheritable

  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 = admin_user.locale if admin_user.respond_to?(:locale)
  end

  def zero_users
    Typus.user_class.count.zero?
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
typus-3.0.12 app/controllers/admin/base_controller.rb
typus-3.0.11 app/controllers/admin/base_controller.rb
typus-3.0.11.rc5 app/controllers/admin/base_controller.rb
typus-3.0.11.rc4 app/controllers/admin/base_controller.rb
typus-3.0.11.rc3 app/controllers/admin/base_controller.rb
typus-3.0.11.rc2 app/controllers/admin/base_controller.rb
typus-3.0.11.rc1 app/controllers/admin/base_controller.rb