Skip to content

Commit

Permalink
Provide a memoized helper for current phase inside a request. Refs eu…
Browse files Browse the repository at this point in the history
  • Loading branch information
nikosd committed Apr 21, 2013
1 parent 4afa294 commit 70c5895
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class ApplicationController < ActionController::Base
protect_from_forgery
check_authorization

helper_method :current_user, :user_signed_in?
helper_method :current_user, :user_signed_in?, :current_phase

before_filter :reload_settings if Rails.env.development?

Expand Down Expand Up @@ -36,4 +36,8 @@ def user_signed_in?
def current_user
@current_user ||= User.find_by_id(session[:user_id]) if session[:user_id]
end

def current_phase
@current_phase ||= Phase.current
end
end

0 comments on commit 70c5895

Please sign in to comment.