Skip to content

Commit

Permalink
Fix the error message reported by Airbrake:
Browse files Browse the repository at this point in the history
Error Message:
NoMethodError: undefined method `downcase' for nil:NilClass
Where:
submitted_content#edit
[PROJECT_ROOT]/app/helpers/access_helper.rb, line 10
  • Loading branch information
yangsong8 committed Sep 6, 2015
1 parent a030155 commit a93c610
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/helpers/access_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def authorize
end

def flash_msg
flash[:error] = "This #{current_role_name.downcase} is not allowed to #{params[:action]} this #{params[:controller]}"
flash[:error] = "This #{current_role_name.try(:downcase)} is not allowed to #{params[:action]} this #{params[:controller]}"
end

def all_actions_allowed?
Expand Down

0 comments on commit a93c610

Please sign in to comment.