Skip to content

Commit

Permalink
refactor methods [#89]
Browse files Browse the repository at this point in the history
  • Loading branch information
Anna Anks Nowak committed Mar 22, 2016
1 parent abf6f81 commit 3563cb5
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,14 @@ def show_current_controller
end

def require_login(return_point = request.url)
if current_person.blank?
set_return_point(return_point)
flash[:error] = t('errors.restricted')
redirect_to login_path
end
return unless current_person.blank?
set_return_point(return_point)
flash[:error] = t('errors.restricted')
redirect_to login_path
end

def set_return_point(path)
if session[:return_point].blank?
session[:return_point] = path
end
session[:return_point] = path if session[:return_point].blank?
end

def return_point
Expand Down

0 comments on commit 3563cb5

Please sign in to comment.