Applied rubocop.
This commit is contained in:
parent
c2297ff210
commit
0db8519cab
3 changed files with 8 additions and 8 deletions
|
@ -32,7 +32,7 @@ returns:
|
||||||
)
|
)
|
||||||
elsif category == 'work_on'
|
elsif category == 'work_on'
|
||||||
return Ticket::State.where(
|
return Ticket::State.where(
|
||||||
state_type_id: Ticket::StateType.where( name: ['new', 'open'] )
|
state_type_id: Ticket::StateType.where( name: %w(new open) )
|
||||||
)
|
)
|
||||||
elsif category == 'work_on_all'
|
elsif category == 'work_on_all'
|
||||||
return Ticket::State.where(
|
return Ticket::State.where(
|
||||||
|
@ -40,7 +40,7 @@ returns:
|
||||||
)
|
)
|
||||||
elsif category == 'closed'
|
elsif category == 'closed'
|
||||||
return Ticket::State.where(
|
return Ticket::State.where(
|
||||||
state_type_id: Ticket::StateType.where( name: ['closed'] )
|
state_type_id: Ticket::StateType.where( name: %w(closed) )
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
fail "Unknown category '#{category}'"
|
fail "Unknown category '#{category}'"
|
||||||
|
|
|
@ -43,9 +43,9 @@ returns
|
||||||
|
|
||||||
# calculate average
|
# calculate average
|
||||||
backend_average_sum = {}
|
backend_average_sum = {}
|
||||||
user_result.each {|user_id, data|
|
user_result.each {|_user_id, data|
|
||||||
data.each {|backend_model, backend_result|
|
data.each {|backend_model, backend_result|
|
||||||
next if !backend_result.has_key?(:used_for_average)
|
next if !backend_result.key?(:used_for_average)
|
||||||
if !backend_average_sum[backend_model]
|
if !backend_average_sum[backend_model]
|
||||||
backend_average_sum[backend_model] = 0
|
backend_average_sum[backend_model] = 0
|
||||||
end
|
end
|
||||||
|
@ -56,10 +56,10 @@ returns
|
||||||
# generate average stats
|
# generate average stats
|
||||||
backend_average_sum.each {|backend_model_average, result|
|
backend_average_sum.each {|backend_model_average, result|
|
||||||
average = ( result.to_f / agent_count.to_f ).round(1)
|
average = ( result.to_f / agent_count.to_f ).round(1)
|
||||||
user_result.each {|user_id, data|
|
user_result.each {|_user_id, data|
|
||||||
data.each {|backend_model_data, backend_result|
|
data.each {|backend_model_data, backend_result|
|
||||||
next if backend_model_data != backend_model_average
|
next if backend_model_data != backend_model_average
|
||||||
next if !backend_result.has_key?(:used_for_average)
|
next if !backend_result.key?(:used_for_average)
|
||||||
backend_result[:average_per_agent] = average
|
backend_result[:average_per_agent] = average
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue