Skip to content
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

Fix partial address update bug #315

Merged
merged 1 commit into from
Apr 5, 2017
Merged

Fix partial address update bug #315

merged 1 commit into from
Apr 5, 2017

Conversation

bhelx
Copy link
Contributor

@bhelx bhelx commented Mar 22, 2017

Resolves #309

It appears there are two problems biting us here:

  1. The endpoint does not accept partial updates of addresses. You have to send the whole address each time.
  2. address.changed_attributes.clear seems like it was mutating the reference to the attributes. That should probably be changed to be a copy of the attributes and not a reference.

Testing

You should see that when updating the account, every field is serialized for the Address.

require 'securerandom'

require 'logger'
Recurly.logger = Logger.new STDOUT

account = Recurly::Account.create(address: { city: "Brussels", country: "BE", zip: "1000" }, account_code: SecureRandom.uuid)
account.address.address1 = "1234 Rue du Lombard"
account.save!

@bhelx bhelx added the WIP label Mar 22, 2017
@bhelx bhelx requested a review from lmnleaf March 22, 2017 18:15
@bhelx bhelx mentioned this pull request Mar 22, 2017
@bhelx bhelx force-pushed the fix_address_change_bug branch from ced68c1 to 46aee54 Compare March 22, 2017 19:12
@bhelx bhelx force-pushed the fix_address_change_bug branch from 46aee54 to 71ebc9b Compare April 5, 2017 16:39
@bhelx bhelx removed the WIP label Apr 5, 2017
@lmnleaf
Copy link

lmnleaf commented Apr 5, 2017

+1

@lmnleaf lmnleaf merged commit 555a8f0 into master Apr 5, 2017
@lmnleaf lmnleaf deleted the fix_address_change_bug branch April 5, 2017 20:02
@bhelx bhelx mentioned this pull request Apr 5, 2017
@bhelx bhelx added the V2 V2 Client label Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
V2 V2 Client
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fields changed to nil
2 participants