mirror of
https://github.com/meineerde/redmine.git
synced 2026-01-31 11:37:14 +00:00
Avoid executing the same SQL statement multiple times to get the default custom query (#7360).
git-svn-id: http://svn.redmine.org/redmine/trunk@21134 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
633a6fae2a
commit
75aaedfff3
@ -465,6 +465,7 @@ module QueriesHelper
|
||||
else
|
||||
{}
|
||||
end
|
||||
default_query_by_class = {}
|
||||
content_tag('h3', title) + "\n" +
|
||||
content_tag(
|
||||
'ul',
|
||||
@ -473,7 +474,9 @@ module QueriesHelper
|
||||
clear_link = +''
|
||||
clear_link_param = {:set_filter => 1, :sort => '', :project_id => @project}
|
||||
|
||||
if query == query.class.default(project: @project)
|
||||
default_query =
|
||||
default_query_by_class[query.class] ||= query.class.default(project: @project)
|
||||
if query == default_query
|
||||
css << ' default'
|
||||
clear_link_param[:without_default] = 1
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user