Shopify / shopify-api-ruby

ShopifyAPI is a lightweight gem for accessing the Shopify admin REST and GraphQL web services.
MIT License
1.06k stars 473 forks source link

Fix dirty attribute changes on update #1149

Closed nelsonwittwer closed 1 year ago

nelsonwittwer commented 1 year ago

Description

Fixes #1133 and #1037 which both report a substantial issue with tracking what attributes were actually modified by the user since the rest resources were initialized.

The root cause of this issue, as pointed out by @kaarelss, was symbols vs hashes when comparing drift on attributes 🤦 . I also needed to 1) set associations in original_state since our API allows us to modify associated resources and 2) needed to ignore read only attributes in original_state.

How has this been tested?

Checklist: