]> source.dussan.org Git - redmine.git/commitdiff
code cleanup: rubocop: fix Layout/CaseIndentation in app/models/issue_query.rb
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 17 Oct 2019 16:46:05 +0000 (16:46 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 17 Oct 2019 16:46:05 +0000 (16:46 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@18728 e93f8b46-1217-0410-a6f0-8f06a7374b81

.rubocop_todo.yml
app/models/issue_query.rb

index ade1efe0b749fa3de48a215f84a2a50d59ce1268..74c6125598db519c81d42010d63cdc945c9cd8f1 100644 (file)
@@ -67,7 +67,6 @@ Layout/BlockEndNewline:
 # SupportedStyles: case, end
 Layout/CaseIndentation:
   Exclude:
-    - 'app/models/issue_query.rb'
     - 'config/initializers/10-patches.rb'
 
 # Cop supports --auto-correct.
index 8c37be05f2ab9410185a566388a46f94d99d9018..348845a43d5001ce75c91529b25dd1e876a33f4a 100644 (file)
@@ -614,8 +614,8 @@ class IssueQuery < Query
       relation_type = relation_options[:reverse] || relation_type
       join_column, target_join_column = target_join_column, join_column
     end
-
-    sql = case operator
+    sql =
+      case operator
       when "*", "!*"
         op = (operator == "*" ? 'IN' : 'NOT IN')
         "#{Issue.table_name}.id #{op} (SELECT DISTINCT #{IssueRelation.table_name}.#{join_column} FROM #{IssueRelation.table_name} WHERE #{IssueRelation.table_name}.relation_type = '#{self.class.connection.quote_string(relation_type)}')"
@@ -630,7 +630,6 @@ class IssueQuery < Query
         op = (operator == "!o" ? 'NOT IN' : 'IN')
         "#{Issue.table_name}.id #{op} (SELECT DISTINCT #{IssueRelation.table_name}.#{join_column} FROM #{IssueRelation.table_name}, #{Issue.table_name} relissues WHERE #{IssueRelation.table_name}.relation_type = '#{self.class.connection.quote_string(relation_type)}' AND #{IssueRelation.table_name}.#{target_join_column} = relissues.id AND relissues.status_id IN (SELECT id FROM #{IssueStatus.table_name} WHERE is_closed=#{self.class.connection.quoted_false}))"
       end
-
     if relation_options[:sym] == field && !options[:reverse]
       sqls = [sql, sql_for_relations(field, operator, value, :reverse => true)]
       sql = sqls.join(["!", "!*", "!p", '!o'].include?(operator) ? " AND " : " OR ")