Minor improvement for case when ship_address[state] is nil or empty

This commit is contained in:
Roman Smirnov 2012-10-16 15:23:20 +04:00
parent 28c925e1f1
commit dd7834bd2f
1 changed files with 2 additions and 1 deletions

View File

@ -80,7 +80,8 @@ module Spree
# phone is currently blanked in AM's PPX response lib
:phone => @ppx_details.params["phone"] || "(not given)"
if (state = Spree::State.find_by_abbr(ship_address["state"].upcase))
state = Spree::State.find_by_abbr(ship_address["state"].upcase) if ship_address["state"].present?
if state
order_ship_address.state = state
else
order_ship_address.state_name = ship_address["state"]