Class: Types::TimeTracking::TimelogConnectionType

Inherits:
CountableConnectionType show all
Defined in:
app/graphql/types/time_tracking/timelog_connection_type.rb

Overview

rubocop: disable Graphql/AuthorizeTypes

Constant Summary

Constants inherited from CountableConnectionType

CountableConnectionType::COUNT_DESCRIPTION

Instance Method Summary collapse

Methods inherited from CountableConnectionType

#count

Methods included from CountableConnectionHelper

#limited_count

Instance Method Details

#total_spent_timeObject



12
13
14
15
16
17
18
19
# File 'app/graphql/types/time_tracking/timelog_connection_type.rb', line 12

def total_spent_time
  relation = object.items

  # sometimes relation is an Array
  relation = relation.without_order if relation.respond_to?(:reorder)

  relation.sum(:time_spent)
end