Skip to content

Commit 9353052

Browse files
committed
Fix check for forwarding env var
Apparently `present?` wasn't available probably because it's an ActiveSupport thing. Now parsing the phone number as an integer to validate the format.
1 parent 5ab9af2 commit 9353052

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

views/welcome.builder

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
if ENV["FORWARD_PHONE_TO"].present?
1+
if ENV.fetch("FORWARD_PHONE_TO", false)
22
# Number must include area code and not have any other special characters.
3-
xml.Dial ENV["FORWARD_PHONE_TO"]
3+
xml.Dial Integer(ENV["FORWARD_PHONE_TO"]).to_s
44
else
55
xml.Gather timeout: 5, action: "/menu", numDigits: "1" do |g|
66
g.Play sound_url("welcome")

0 commit comments

Comments
 (0)