Skip to content

Commit 4b1d1d5

Browse files
committed
Reduced redundancy
1 parent 9f7c584 commit 4b1d1d5

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

app/controllers/volunteers_controller.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,9 @@ def create
3434
if @volunteer.save && @volunteer.email.match?(URI::MailTo::EMAIL_REGEXP)
3535
@volunteer.invite!(current_user)
3636
# call short io api here
37-
raw_token = @volunteer.raw_invitation_token
38-
invitation_url = Rails.application.routes.url_helpers.accept_user_invitation_url(invitation_token: raw_token, host: request.base_url)
37+
invitation_url = Rails.application.routes.url_helpers.accept_user_invitation_url(invitation_token: @volunteer.raw_invitation_token, host: request.base_url)
3938
hash_of_short_urls = @volunteer.phone_number.blank? ? {0 => nil, 1 => nil} : handle_short_url([invitation_url, request.base_url + "/users/edit"])
40-
body_msg = account_activation_msg("volunteer", hash_of_short_urls)
41-
sms_status = deliver_sms_to @volunteer, body_msg
39+
sms_status = deliver_sms_to @volunteer, account_activation_msg("volunteer", hash_of_short_urls)
4240
redirect_to edit_volunteer_path(@volunteer), notice: sms_acct_creation_notice("volunteer", sms_status)
4341
else
4442
render :new, status: :unprocessable_entity

0 commit comments

Comments
 (0)