Sha256: 96624d025019c3d82171cb352ad42f54cca3abcd091df6810cec9a6677648666

Contents?: true

Size: 565 Bytes

Versions: 11

Compression:

Stored size: 565 Bytes

Contents

module Spina
  class ApplicationController < ActionController::Base

    protect_from_forgery with: :exception

    private

    def current_theme
      @current_theme = ::Spina::Theme.find_by_name(current_account.theme)
    end
    helper_method :current_theme

    def current_spina_user
      @current_spina_user ||= ::Spina::User.where(id: session[:user_id]).first if session[:user_id]
    end
    helper_method :current_spina_user

    def current_account
      @current_account ||= ::Spina::Account.first
    end
    helper_method :current_account

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
spina-1.2.0 app/controllers/spina/application_controller.rb
spina-1.1.4 app/controllers/spina/application_controller.rb
spina-1.1.3 app/controllers/spina/application_controller.rb
spina-1.1.2 app/controllers/spina/application_controller.rb
spina-1.1.1 app/controllers/spina/application_controller.rb
spina-1.1.0 app/controllers/spina/application_controller.rb
spina-1.0.3 app/controllers/spina/application_controller.rb
spina-1.0.2 app/controllers/spina/application_controller.rb
spina-1.0.1 app/controllers/spina/application_controller.rb
spina-1.0.0 app/controllers/spina/application_controller.rb
spina-0.12.0 app/controllers/spina/application_controller.rb