Skip to content
This repository was archived by the owner on Apr 14, 2023. It is now read-only.

Address improvements #38

Merged
merged 2 commits into from
Oct 26, 2016
Merged

Address improvements #38

merged 2 commits into from
Oct 26, 2016

Conversation

cbrunsdon
Copy link
Contributor

This pushes more responsibility onto the TransactionAddress, making it responsible for translating itself into its equivalent Spree address representations.

@cbrunsdon cbrunsdon force-pushed the address_improvements branch 4 times, most recently from b1fc148 to bb5eddd Compare October 26, 2016 02:23
Lets us keep the logic of translating transaction addresses into solidus
addresses in one place
@cbrunsdon cbrunsdon force-pushed the address_improvements branch from bb5eddd to 0189a0f Compare October 26, 2016 02:24
address2: ta.address_line_2,
zipcode: ta.zip,
phone: transaction.phone
transaction.address && transaction.address.to_spree_address.try do |address|
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would to_spree_address every return nil? I don't think this try provides anything.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pretty sure I wanted a .tap there...

@cbrunsdon cbrunsdon force-pushed the address_improvements branch from 0189a0f to 4b28dee Compare October 26, 2016 17:14
@cbrunsdon cbrunsdon dismissed adammathys’s stale review October 26, 2016 17:19

switched to a .tap

phone: transaction.phone
transaction.address && transaction.address.to_spree_address.tap do |address|
address.phone = transaction.phone
address
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need to return the object in a tap.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed, thanks

Useful in a few places to translate transaction addresses
@cbrunsdon cbrunsdon force-pushed the address_improvements branch from 4b28dee to ad4bf67 Compare October 26, 2016 17:53
@cbrunsdon cbrunsdon merged commit 5245c73 into master Oct 26, 2016
@adammathys adammathys deleted the address_improvements branch October 26, 2016 20:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants