For any of the ShopifyAPI models, for example ShopifyAPI::Fulfillment, ShopifyAPI::PriceRule, etc, when creating them with the SDK and calling the .save method, the 'id' attribute is not updated. So after saving, trying to find the ID of the newly saved record is not possible.
For example:
fulfillment = ShopifyAPI::Fulfillment.new(session: ...)
fulfillment.status = "success"
# set other attributes ...
fulfillment.save # successful save of new fulfillment
puts fulfillment.id # ==> nil :( :( :(
Expected behavior
After successfully creating a ShopifyAPI object, the .id property should be set to the newly created ID of the object in Shopify.
Actual behavior
No value is set and nil is returned when accessing the ID.
Issue summary
For any of the ShopifyAPI models, for example
ShopifyAPI::Fulfillment
,ShopifyAPI::PriceRule
, etc, when creating them with the SDK and calling the.save
method, the 'id' attribute is not updated. So after saving, trying to find the ID of the newly saved record is not possible.For example:
Expected behavior
After successfully creating a ShopifyAPI object, the
.id
property should be set to the newly created ID of the object in Shopify.Actual behavior
No value is set and
nil
is returned when accessing the ID.