Преглед на файлове

Don't hard code xml URLs

The Shopify API supports JSON as well as XML,
these two method calls were causing clients to
receive XML responses, even when they had told
ActiveResource to use JSON.
Jesse Storimer преди 15 години
родител
ревизия
311879ae04
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      lib/shopify_api.rb

+ 2 - 2
lib/shopify_api.rb

@@ -190,7 +190,7 @@ module ShopifyAPI
   # the shop.
   # the shop.
   class Shop < Base
   class Shop < Base
     def self.current
     def self.current
-      find(:one, :from => "/admin/shop.xml")
+      find(:one, :from => "/admin/shop.#{format.extension}")
     end
     end
     
     
     def metafields
     def metafields
@@ -423,7 +423,7 @@ module ShopifyAPI
       if args[0].is_a?(Symbol)
       if args[0].is_a?(Symbol)
         super
         super
       else
       else
-        find(:one, :from => "/admin/assets.xml", :params => {:asset => {:key => args[0]}})
+        find(:one, :from => "/admin/assets.#{format.extension}", :params => {:asset => {:key => args[0]}})
       end
       end
     end
     end