Skip to content

Commit 260803b

Browse files
committed
change to if statement
1 parent 4b1d1d5 commit 260803b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

app/controllers/volunteers_controller.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@ def create
3535
@volunteer.invite!(current_user)
3636
# call short io api here
3737
invitation_url = Rails.application.routes.url_helpers.accept_user_invitation_url(invitation_token: @volunteer.raw_invitation_token, host: request.base_url)
38-
hash_of_short_urls = @volunteer.phone_number.blank? ? {0 => nil, 1 => nil} : handle_short_url([invitation_url, request.base_url + "/users/edit"])
38+
39+
hash_of_short_urls = {0 => nil, 1 => nil}
40+
if @volunteer.phone_number.present?
41+
handle_short_url([invitation_url, request.base_url + "/users/edit"])
42+
end
43+
3944
sms_status = deliver_sms_to @volunteer, account_activation_msg("volunteer", hash_of_short_urls)
4045
redirect_to edit_volunteer_path(@volunteer), notice: sms_acct_creation_notice("volunteer", sms_status)
4146
else

0 commit comments

Comments
 (0)