Class: Types::WorkItems::Widgets::TimeTracking::TimelogType

Inherits:
BaseObject
  • Object
show all
Defined in:
app/graphql/types/work_items/widgets/time_tracking/timelog_type.rb

Overview

rubocop:disable Graphql/AuthorizeTypes – we already authorize the work item itself

Instance Method Summary collapse

Methods inherited from BaseObject

accepts, assignable?, authorization, authorization_scopes, authorize, authorized?, #current_user, #id

Methods included from Gitlab::Graphql::Present

#present, #unpresented

Instance Method Details

#spent_atObject



42
43
44
# File 'app/graphql/types/work_items/widgets/time_tracking/timelog_type.rb', line 42

def spent_at
  object.spent_at || object.created_at
end

#userObject



38
39
40
# File 'app/graphql/types/work_items/widgets/time_tracking/timelog_type.rb', line 38

def user
  Gitlab::Graphql::Loaders::BatchModelLoader.new(User, object.user_id).find
end