Skip to content
This repository has been archived by the owner on Jun 30, 2020. It is now read-only.

Using [] should give the same result than the accessor #6

Merged

Conversation

fonji
Copy link

@fonji fonji commented Dec 19, 2019

Currently, this is what happens

contact = Hubspot::Contact.find(id)
contact[:firstname]
# => {"value"=>"Bruce", "versions"=>[redacted]} 
contact.firstname
# => "Bruce"

Which is already inconsistent but how about this?

contact = Hubspot::Contact.new(firstname: 'Bruce')
contact[:firstname]
# => 'Bruce'
contact.firstname
# => "Bruce"

This PR fixes this by having #[] always giving the value.

Upstream PR: HubspotCommunity#218

@jplot jplot merged commit 2f46b7f into lounna-team:master Dec 31, 2019
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