Follow-up from "Resolve "Optimize Routable.where_full_path_in by avoiding joins""
The following discussion from !137886 (merged) should be addressed:
-
@tkuah started a discussion: source_type_condition = { source_type: route_scope.klass.base_class } routes_matching_condition = Route.where(source_type_condition).where(wheres.join(' OR ')) source_ids = routes_matching_condition.pluck(:source_id) route_scope = all result = route_scope.where(id: source_ids)
Suggestion:, minor restructure to group related variables together.