Class: Types::TimelogType

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

Instance Method Summary collapse

Methods inherited from BaseObject

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

Methods included from Gitlab::Graphql::Present

#present, #unpresented

Instance Method Details

#issueObject


54
55
56
# File 'app/graphql/types/timelog_type.rb', line 54

def issue
  Gitlab::Graphql::Loaders::BatchModelLoader.new(Issue, object.issue_id).find
end

#spent_atObject


58
59
60
# File 'app/graphql/types/timelog_type.rb', line 58

def spent_at
  object.spent_at || object.created_at
end

#userObject


50
51
52
# File 'app/graphql/types/timelog_type.rb', line 50

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