mirror of
https://github.com/redmine/redmine.git
synced 2025-12-16 21:40:28 +01:00
code cleanup: rubocop: fix Layout/SpaceBeforeSemicolon and Style/WhenThen in app/models/issue_query.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@18725 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -312,7 +312,6 @@ Layout/SpaceBeforeFirstArg:
|
|||||||
# Cop supports --auto-correct.
|
# Cop supports --auto-correct.
|
||||||
Layout/SpaceBeforeSemicolon:
|
Layout/SpaceBeforeSemicolon:
|
||||||
Exclude:
|
Exclude:
|
||||||
- 'app/models/issue_query.rb'
|
|
||||||
- 'app/models/user_preference.rb'
|
- 'app/models/user_preference.rb'
|
||||||
- 'config/initializers/10-patches.rb'
|
- 'config/initializers/10-patches.rb'
|
||||||
|
|
||||||
@@ -1460,11 +1459,6 @@ Style/VariableInterpolation:
|
|||||||
Exclude:
|
Exclude:
|
||||||
- 'lib/redmine/configuration.rb'
|
- 'lib/redmine/configuration.rb'
|
||||||
|
|
||||||
# Cop supports --auto-correct.
|
|
||||||
Style/WhenThen:
|
|
||||||
Exclude:
|
|
||||||
- 'app/models/issue_query.rb'
|
|
||||||
|
|
||||||
# Cop supports --auto-correct.
|
# Cop supports --auto-correct.
|
||||||
Style/WhileUntilModifier:
|
Style/WhileUntilModifier:
|
||||||
Exclude:
|
Exclude:
|
||||||
|
|||||||
@@ -416,16 +416,15 @@ class IssueQuery < Query
|
|||||||
|
|
||||||
def sql_for_spent_time_field(field, operator, value)
|
def sql_for_spent_time_field(field, operator, value)
|
||||||
first, second = value.first.to_f, value.second.to_f
|
first, second = value.first.to_f, value.second.to_f
|
||||||
|
|
||||||
sql_op =
|
sql_op =
|
||||||
case operator
|
case operator
|
||||||
when "=", ">=", "<=" ; "#{operator} #{first}"
|
when "=", ">=", "<=" then "#{operator} #{first}"
|
||||||
when "><" ; "BETWEEN #{first} AND #{second}"
|
when "><" then "BETWEEN #{first} AND #{second}"
|
||||||
when "*" ; "> 0"
|
when "*" then "> 0"
|
||||||
when "!*" ; "= 0"
|
when "!*" then "= 0"
|
||||||
else ; return nil
|
else
|
||||||
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
"COALESCE((" +
|
"COALESCE((" +
|
||||||
"SELECT ROUND(CAST(SUM(hours) AS DECIMAL(30,3)), 2) " +
|
"SELECT ROUND(CAST(SUM(hours) AS DECIMAL(30,3)), 2) " +
|
||||||
"FROM #{TimeEntry.table_name} " +
|
"FROM #{TimeEntry.table_name} " +
|
||||||
|
|||||||
Reference in New Issue
Block a user