Sha256: e30a3c3fa65d4d7991a14d83cf57bdd2eeb5218ac2ea5ee26b11de16cd6cc5a9

Contents?: true

Size: 286 Bytes

Versions: 4

Compression:

Stored size: 286 Bytes

Contents

class ApplicationController < ActionController::Base
  protect_from_forgery
  
  helper_method :current_user
  
  def current_user
    begin
      session[:current_user_id] ? User.find(session[:current_user_id]) : nil
    rescue ActiveRecord::RecordNotFound
      nil
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
conversations-0.0.2.2 spec/dummy/app/controllers/application_controller.rb
conversations-0.0.2.1 spec/dummy/app/controllers/application_controller.rb
conversations-0.0.2 spec/dummy/app/controllers/application_controller.rb
conversations-0.0.1 spec/dummy/app/controllers/application_controller.rb