]> source.dussan.org Git - redmine.git/commitdiff
code cleanup: rubocop: fix Style/WhileUntilModifier in app/helpers/queries_helper.rb
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 19 Oct 2019 04:29:47 +0000 (04:29 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 19 Oct 2019 04:29:47 +0000 (04:29 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@18733 e93f8b46-1217-0410-a6f0-8f06a7374b81

.rubocop_todo.yml
app/helpers/queries_helper.rb

index f5d7148842af924d68c7a33cd9e0584266219600..9078a7fda99bfc40a53a8c78afb701d402ce0634 100644 (file)
@@ -1453,7 +1453,6 @@ Style/VariableInterpolation:
 # Cop supports --auto-correct.
 Style/WhileUntilModifier:
   Exclude:
-    - 'app/helpers/queries_helper.rb'
     - 'app/models/attachment.rb'
     - 'app/models/project.rb'
     - 'lib/redmine/unified_diff.rb'
index a9dce745675da9cab5ef84a37749346149c25e96..fa03a76ef11dc63a80b5dc8cf5aff743d6dab59c 100644 (file)
@@ -180,10 +180,8 @@ module QueriesHelper
         end
       end
       param_key = options[:sort_param] || :sort
-      sort_param = { param_key => query.sort_criteria.add(column.name, order).to_param }
-      while sort_param.keys.first.to_s =~ /^(.+)\[(.+)\]$/
-        sort_param = {$1 => {$2 => sort_param.values.first}}
-      end
+      sort_param = {param_key => query.sort_criteria.add(column.name, order).to_param}
+      sort_param = {$1 => {$2 => sort_param.values.first}} while sort_param.keys.first.to_s =~ /^(.+)\[(.+)\]$/
       link_options = {
           :title => l(:label_sort_by, "\"#{column.caption}\""),
           :class => css