瀏覽代碼

Assume threadsafe headers.

Gareth du Plooy 5 年之前
父節點
當前提交
d124e7fdb2
共有 1 個文件被更改,包括 7 次插入20 次删除
  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