formatted_payload in resource.rb returns incomplete hash
stefanosello opened this issue · comments
mailjet-gem/lib/mailjet/resource.rb
Line 320 in 675f75f
When trying to update a Mailjet::Contact
through the update_attributes
method, the remote instance doesn't get updated.
For example:
target = Mailjet::Contact.find("example@domain.com")
target.update_attributes("is_excluded_from_campaigns" => true)
doesn't change the remote Contact instance, according to the Mailjet console.
Debugging a little bit it turned out that the update api gets called with the return value of formatted_payload
as body, and that such method selects only a restricted set of attributes if the local instance is persisted (the linked code row is the exact point where this happens). Is this the correct behaviour?
Fixed in version 1.7.1. Closing.