Sfoglia il codice sorgente

Assume threadsafe headers.

Gareth du Plooy 5 anni fa
parent
commit
d124e7fdb2
1 ha cambiato i file con 7 aggiunte e 20 eliminazioni
  1. 7 20
      lib/shopify_api/resources/base.rb

+ 7 - 20
lib/shopify_api/resources/base.rb

@@ -30,26 +30,13 @@ module ShopifyAPI
 
     class << self
       threadsafe_attribute(:_api_version)
-
-      if ActiveResource::Base.respond_to?(:_headers) && ActiveResource::Base.respond_to?(:_headers_defined?)
-        def headers
-          if _headers_defined?
-            _headers
-          elsif superclass != Object && superclass.headers
-            superclass.headers
-          else
-            _headers ||= {}
-          end
-        end
-      else
-        def headers
-          if defined?(@headers)
-            @headers
-          elsif superclass != Object && superclass.headers
-            superclass.headers
-          else
-            @headers ||= {}
-          end
+      def headers
+        if _headers_defined?
+          _headers
+        elsif superclass != Object && superclass.headers
+          superclass.headers
+        else
+          _headers ||= {}
         end
       end