Skip to content

Commit

Permalink
Improve code readability
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhughes committed Aug 19, 2016
1 parent f00b624 commit b72bc8b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/controllers/user_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,13 @@ def confirm_email
@user.email = @user.new_email
@user.new_email = nil
@user.email_valid = true
changed = gravatar_enable(@user)
gravatar_enabled = gravatar_enable(@user)
if @user.save
flash[:notice] = (t "user.confirm_email.success") + (changed ? " " + gravatar_status_message(@user) : "")
flash[:notice] = if gravatar_enabled
t("user.confirm_email.success") + " " + gravatar_status_message(@user)
else
t("user.confirm_email.success")
end
else
flash[:errors] = @user.errors
end
Expand Down

0 comments on commit b72bc8b

Please sign in to comment.