diff options
author | Go MAEDA <maeda@farend.jp> | 2019-03-17 00:29:58 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2019-03-17 00:29:58 +0000 |
commit | d4daf4e23b2cab7f02f49aa9e5c3cf328ce37407 (patch) | |
tree | 30669965c6062db7047c48f35ba4cbd44e61dcd8 /app/helpers/queries_helper.rb | |
parent | 46208a6743b16f8f9030318a773abdc268899c33 (diff) | |
download | redmine-d4daf4e23b2cab7f02f49aa9e5c3cf328ce37407.tar.gz redmine-d4daf4e23b2cab7f02f49aa9e5c3cf328ce37407.zip |
Support frozen_string_literal in issue, journal, and query (#26561).
Patch by Pavel Rosický.
git-svn-id: http://svn.redmine.org/redmine/trunk@17980 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers/queries_helper.rb')
-rw-r--r-- | app/helpers/queries_helper.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/helpers/queries_helper.rb b/app/helpers/queries_helper.rb index f57a44ae5..24207b4c1 100644 --- a/app/helpers/queries_helper.rb +++ b/app/helpers/queries_helper.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true # Redmine - project management software # Copyright (C) 2006-2017 Jean-Philippe Lang @@ -290,9 +290,9 @@ module QueriesHelper session_key = klass.name.underscore.to_sym if params[:query_id].present? - cond = "project_id IS NULL" - cond << " OR project_id = #{@project.id}" if @project - @query = klass.where(cond).find(params[:query_id]) + scope = klass.where(:project_id => nil) + scope = scope.or(klass.where(:project_id => @project)) if @project + @query = scope.find(params[:query_id]) raise ::Unauthorized unless @query.visible? @query.project = @project session[session_key] = {:id => @query.id, :project_id => @query.project_id} if use_session @@ -389,7 +389,7 @@ module QueriesHelper content_tag('h3', title) + "\n" + content_tag('ul', queries.collect {|query| - css = 'query' + css = +'query' css << ' selected' if query == @query content_tag('li', link_to(query.name, url_params.merge(:query_id => query), :class => css)) }.join("\n").html_safe, |