mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-19 15:01:14 +00:00
code cleanup: rubocop: fix Layout/CaseIndentation in app/models/issue_query.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@18728 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
2140c49042
commit
a8b7aa8299
@ -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.
|
||||
|
||||
@ -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 ")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user