Sha256: 365775f9d80ffa4d9f326649aef4971ed7e2d58b6c26d2643231c263927b808d

Contents?: true

Size: 349 Bytes

Versions: 2

Compression:

Stored size: 349 Bytes

Contents

class ApplicationController < ActionController::Base
  protect_from_forgery
  
  def current_user
    @current_user ||= User.find_by_id(session[:user_id])
  end
  
  def signed_in?
    !!current_user
  end
  
  helper_method :current_user, :signed_in?
  
  def current_user=(user)
    @current_user = user
    session[:user_id] = user.id
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
kublog-0.9.0 spec/dummy/app/controllers/application_controller.rb
kublog-0.0.1.1 test/dummy/app/controllers/application_controller.rb