diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-06-29 16:06:37 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-06-29 16:06:37 +0000 |
commit | 004fc8b84b1cebc521664ca3830f969a91244e67 (patch) | |
tree | f84169227818ebd9365df50aeb446a2c8b977fe5 /app/models/query.rb | |
parent | 3834b3d2ef2b7ceab8942e95b66e5a3cae63dce7 (diff) | |
download | redmine-004fc8b84b1cebc521664ca3830f969a91244e67.tar.gz redmine-004fc8b84b1cebc521664ca3830f969a91244e67.zip |
Fixed that user with "Manage public queries" permission, can create global public query (#19842).
git-svn-id: http://svn.redmine.org/redmine/trunk@14388 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/query.rb')
-rw-r--r-- | app/models/query.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/query.rb b/app/models/query.rb index cac43a4e4..b77f76c2e 100644 --- a/app/models/query.rb +++ b/app/models/query.rb @@ -487,7 +487,9 @@ class Query < ActiveRecord::Base if arg.is_a?(Hash) arg = arg.keys.sort.collect {|k| arg[k]} end - c = arg.select {|k,o| !k.to_s.blank?}.slice(0,3).collect {|k,o| [k.to_s, (o == 'desc' || o == false) ? 'desc' : 'asc']} + if arg + c = arg.select {|k,o| !k.to_s.blank?}.slice(0,3).collect {|k,o| [k.to_s, (o == 'desc' || o == false) ? 'desc' : 'asc']} + end write_attribute(:sort_criteria, c) end |