From db0ac01d3d3177bb0c9b03d0a9e2ec120f701921 Mon Sep 17 00:00:00 2001 From: Marius Balteanu Date: Sat, 23 Nov 2024 11:17:54 +0000 Subject: Fixes project query scope that does not take into account limit and offset options (#41791). git-svn-id: https://svn.redmine.org/redmine/trunk@23300 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/project_query.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/models/project_query.rb b/app/models/project_query.rb index 6defbcc83..726721bd8 100644 --- a/app/models/project_query.rb +++ b/app/models/project_query.rb @@ -156,7 +156,9 @@ class ProjectQuery < Query order_option << "#{Project.table_name}.lft ASC" scope = base_scope. order(order_option). - joins(joins_for_order_statement(order_option.join(','))) + joins(joins_for_order_statement(order_option.join(','))). + limit(options[:limit]). + offset(options[:offset]) if has_custom_field_column? scope = scope.preload(:custom_values) -- cgit v1.2.3