diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-03-15 18:14:58 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-03-15 18:14:58 +0000 |
commit | c23f126f1fa233c8bccddb7e4e113a20610e4252 (patch) | |
tree | 7f4b536047e2719e970589bcfcd7c197908cc45d /app/models | |
parent | 674e1752e6fc6fc09efbf8a7a2b916c77c03bcee (diff) | |
download | redmine-c23f126f1fa233c8bccddb7e4e113a20610e4252.tar.gz redmine-c23f126f1fa233c8bccddb7e4e113a20610e4252.zip |
Fix link to issues when displaying a project query (#1565).
git-svn-id: http://svn.redmine.org/redmine/trunk@16409 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/query.rb | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/app/models/query.rb b/app/models/query.rb index 23eca0278..a0f1969e3 100644 --- a/app/models/query.rb +++ b/app/models/query.rb @@ -387,19 +387,23 @@ class Query < ActiveRecord::Base end def as_params - params = {} - filters.each do |field, options| - params[:f] ||= [] - params[:f] << field - params[:op] ||= {} - params[:op][field] = options[:operator] - params[:v] ||= {} - params[:v][field] = options[:values] + if new_record? + params = {} + filters.each do |field, options| + params[:f] ||= [] + params[:f] << field + params[:op] ||= {} + params[:op][field] = options[:operator] + params[:v] ||= {} + params[:v][field] = options[:values] + end + params[:c] = column_names + params[:sort] = sort_criteria.to_param + params[:set_filter] = 1 + params + else + {:query_id => id} end - params[:c] = column_names - params[:sort] = sort_criteria.to_param - params[:set_filter] = 1 - params end def validate_query_filters |