Class: Types::Notes::NoteType
- Inherits:
-
BaseObject
- Object
- GraphQL::Schema::Object
- BaseObject
- Types::Notes::NoteType
show all
- Includes:
- ActionView::Helpers::SanitizeHelper
- Defined in:
- app/graphql/types/notes/note_type.rb
Instance Method Summary
collapse
Methods inherited from BaseObject
accepts, assignable?, authorization, authorization_scopes, authorize, authorized?, #current_user
#present, #unpresented
Instance Method Details
#id ⇒ Object
We now support also SyntheticNote notes as a NoteType, but SyntheticNote does not have a real note ID, as SyntheticNote is generated dynamically from a ResourceEvent instance.
80
81
82
83
84
85
|
# File 'app/graphql/types/notes/note_type.rb', line 80
def id
return super unless object.is_a?(SyntheticNote)
::Gitlab::GlobalId.build(object, model_name: object.object.class.to_s, id: object.discussion_id)
end
|
#note_project ⇒ Object
87
88
89
|
# File 'app/graphql/types/notes/note_type.rb', line 87
def note_project
object.project
end
|
#position ⇒ Object
91
92
93
|
# File 'app/graphql/types/notes/note_type.rb', line 91
def position
object.position if object.position.is_a?(Gitlab::Diff::Position)
end
|
#system_note_icon_name ⇒ Object