end
end.compact
- @objects = klass.readable_by(*@read_users).
- order(request_order).where(where_conds)
+ if klass == Collection and params[:include_trash]
+ @objects = klass.unscoped.readable_by(*@read_users).
+ order(request_order).where(where_conds)
+ else
+ @objects = klass.readable_by(*@read_users).
+ order(request_order).where(where_conds)
+ end
klass_limit = limit_all - all_objects.count
@limit = klass_limit
apply_where_limit_order_params klass
if klass_object_list[:limit] < klass_limit
# object_list() had to reduce @limit to comply with
- # max_index_database_read. We have to stop now.
- break
+ # max_index_database_read. From now on, we'll do all queries
+ # with limit=0 and just accumulate items_available.
+ limit_all = all_objects.count
end
end