lib/scrivito/backend/obj_query.rb in scrivito_sdk-1.9.1 vs lib/scrivito/backend/obj_query.rb in scrivito_sdk-1.10.0.rc1
- old
+ new
@@ -1,12 +1,11 @@
module Scrivito
module Backend
module ObjQuery
-class << self
- def query(revision, index, keys)
+ def self.query(revision, index, keys)
cache = Backend::ObjDataCache.view_for_revision(revision)
missing_keys = []
ids_from_cache = keys.map do |key|
@@ -45,16 +44,14 @@
cache_obj_datas.map do |obj_datas|
obj_datas || grouped_backend_results.shift
end
end
- private
-
# nested_ids is a list containing elements that are either lists of ids or nil
# returns a corresponding list
# containing elements that are either lists of obj_datas or nil
- def load_nested_ids(revision, nested_ids)
+ private_class_method def self.load_nested_ids(revision, nested_ids)
all_ids = nested_ids.inject([]) do |list, ids|
ids ? list + ids : list
end
all_obj_datas = Backend::ObjLoad.load(revision, all_ids)
@@ -64,10 +61,9 @@
# in the cache, but have been deleted in the backend concurrently.
all_obj_datas.shift(ids.length).compact if ids
end
end
-end
end
end
end