Skip to content

Commit

Permalink
use case when for computing the corresponding application status #242
Browse files Browse the repository at this point in the history
  • Loading branch information
aloeser committed Jan 24, 2017
1 parent 65d1d57 commit e82d809
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions app/controllers/emails_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,14 @@ def get_email_template_status
end

def get_corresponding_application_letter_status
return :accepted if params[:status] == "acceptance"
return :rejected if params[:status] == "rejection"
# default value
return :accepted
case params[:status]
when "acceptance"
return :accepted
when "rejection"
return :rejected
else
return :accepted
end
end

# Only allow a trusted parameter "white list" through.
Expand Down

0 comments on commit e82d809

Please sign in to comment.