소스 검색

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