Browse Source

Properly convert single hash to array of hashes

Scott King 7 năm trước cách đây
mục cha
commit
4aed8edeb4
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      lib/shopify_api/resources/marketing_event.rb

+ 1 - 1
lib/shopify_api/resources/marketing_event.rb

@@ -1,7 +1,7 @@
 module ShopifyAPI
   class MarketingEvent < Base
     def add_engagements(engagements)
-      engagements = { engagements: Array(engagements) }
+      engagements = { engagements: Array.wrap(engagements) }
       post(:engagements, {}, engagements.to_json)
     end
   end