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



60
61
62
# File 'app/graphql/types/timelog_type.rb', line 60

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

#spent_atObject



64
65
66
# File 'app/graphql/types/timelog_type.rb', line 64

def spent_at
  object.spent_at || object.created_at
end

#userObject



56
57
58
# File 'app/graphql/types/timelog_type.rb', line 56

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