app/cms/scrivito/obj_collection.rb in scrivito_sdk-1.16.0 vs app/cms/scrivito/obj_collection.rb in scrivito_sdk-1.17.0.rc1
- old
+ new
@@ -96,12 +96,12 @@
# @api public
def find_all_by_obj_class(obj_class)
all.and(:_obj_class, :equals, obj_class)
end
- def find_one_by(view, value, **options)
- find_by(view, [value], options).first.min_by(&:id)
+ def find_one_by(view, value, obj_class_name = nil)
+ find_by(view, [value], obj_class_name).first.min_by(&:id)
end
def find_by_parent_path(path)
find_by(:ppath, [path]).first
end
@@ -136,16 +136,16 @@
obj or raise ResourceNotFound, "Could not find Obj with id #{id_or_list}"
end
end
- def find_by(view, keys, **options)
- find_by_including_deleted(view, keys, options).each { |objs| objs.reject!(&:deleted?) }
+ def find_by(view, keys, obj_class_name = nil)
+ find_by_including_deleted(view, keys, obj_class_name).each { |objs| objs.reject!(&:deleted?) }
end
# Accepts the name of an "obj_by" view, a list of keys.
# Returns a list of lists of Objs: a list of Objs for each given key.
- def find_by_including_deleted(view, keys, obj_class_name: nil)
+ def find_by_including_deleted(view, keys, obj_class_name = nil)
revision = workspace.revision
CmsBackend.find_obj_data_by(revision, view, keys).map do |obj_datas|
if obj_class_name
obj_datas = obj_datas.select do |obj_data|
obj_class_name == obj_data.value_of('_obj_class')