-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use state_name in rare cases that state_id is nil, this will prevent … #13
base: support-physical-card
Are you sure you want to change the base?
Conversation
This looks harmless and I'll come back to it. My initial reaction is that we have a data problem if we have a |
This is very true but, it's only a data thing (not really a problem). If a country requires states but has no states assigned to it, a text field will show. We really should be disciplined when we go Int to make sure places that we ship to, who are state based, have the correct states added to the country. |
although... this is the billing address... so it's really tricky! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks 💯 David. Do we know what 'state' was written in to cause us to need this fix?
@@ -42,6 +42,10 @@ def bill_to_hash | |||
def normalize_sku(sku) | |||
sku.chomp("-SET") | |||
end | |||
|
|||
def state(address) | |||
address.state ? address.state.name : address.state_name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe I did this very change in another shipping implementation that utilizes XML! Eerily familiar. Anyway, looks 👍
Ah yes, Billing 🇹🇭 |
…the exception
@bryanmtl not exactly sure if this is worth the change - there are only 2 cases of this happening but i can't push the shipment to Quiet because it will cause an exception if state id is nil.