lib/contentful/management/client.rb in contentful-management-0.0.1.pre vs lib/contentful/management/client.rb in contentful-management-0.0.1
- old
+ new
@@ -40,11 +40,11 @@
end
# Use this method together with the client's :dynamic_entries configuration.
# See README for details.
def update_dynamic_entry_cache_for_space!(space)
- update_dynamic_entry_cache!(space.content_types)
+ update_dynamic_entry_cache!(space.content_types.all)
end
def update_dynamic_entry_cache!(content_types)
@dynamic_entry_cache = Hash[
content_types.map do |ct|
@@ -70,10 +70,17 @@
def execute_request(request)
request_url = request.url
url = request.absolute? ? request_url : base_url + request_url
raw_response = yield(url)
+ clear_headers
Response.new(raw_response, request)
+ end
+
+ def clear_headers
+ self.content_type_id = nil
+ self.version = nil
+ self.organization_id = nil
end
def delete(request)
execute_request(request) do |url|
self.class.delete_http(url, {}, request_headers)