How do you only save 1 field when updating via shopify_app gem / REST API?

Using the shopify_app gem for Rails, how do you only save 1 field on an object?

For example, if I want to update a customer’s tags I do this:

customer.update_attributes(tags: "tag 1, tag2")

I would expect that to only update customer.tags, but that’s not the case, it tries to updates the whole Customer object.

The problem is with the Shopify API version 2022-04, if you’re updating the Customer object there is a required field email_marketing_consent. And if that isn’t filled when you retrieve the customer, then the update fails with an error like this: {:email_marketing_consent=>[“The opt-in level is required”]}.

I’ve ran into similar problems in the past but always found a workaround, not this time because that field is required.

Thanks