mirror of
https://github.com/redmine/redmine.git
synced 2025-12-16 13:30: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.
|
||||
Layout/SpaceBeforeSemicolon:
|
||||
Exclude:
|
||||
- 'app/models/issue_query.rb'
|
||||
- 'app/models/user_preference.rb'
|
||||
- 'config/initializers/10-patches.rb'
|
||||
|
||||
@@ -1460,11 +1459,6 @@ Style/VariableInterpolation:
|
||||
Exclude:
|
||||
- 'lib/redmine/configuration.rb'
|
||||
|
||||
# Cop supports --auto-correct.
|
||||
Style/WhenThen:
|
||||
Exclude:
|
||||
- 'app/models/issue_query.rb'
|
||||
|
||||
# Cop supports --auto-correct.
|
||||
Style/WhileUntilModifier:
|
||||
Exclude:
|
||||
|
||||
@@ -416,16 +416,15 @@ class IssueQuery < Query
|
||||
|
||||
def sql_for_spent_time_field(field, operator, value)
|
||||
first, second = value.first.to_f, value.second.to_f
|
||||
|
||||
sql_op =
|
||||
case operator
|
||||
when "=", ">=", "<=" ; "#{operator} #{first}"
|
||||
when "><" ; "BETWEEN #{first} AND #{second}"
|
||||
when "*" ; "> 0"
|
||||
when "!*" ; "= 0"
|
||||
else ; return nil
|
||||
when "=", ">=", "<=" then "#{operator} #{first}"
|
||||
when "><" then "BETWEEN #{first} AND #{second}"
|
||||
when "*" then "> 0"
|
||||
when "!*" then "= 0"
|
||||
else
|
||||
return nil
|
||||
end
|
||||
|
||||
"COALESCE((" +
|
||||
"SELECT ROUND(CAST(SUM(hours) AS DECIMAL(30,3)), 2) " +
|
||||
"FROM #{TimeEntry.table_name} " +
|
||||
|
||||
Reference in New Issue
Block a user