diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2019-06-07 20:13:26 +0300 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2019-06-14 13:36:27 +0300 |
commit | b6ff5f1e141162e701c33647aae5015e5d42cc11 (patch) | |
tree | fb6ec57e96dc811d07c75d6b32f9471263c85166 /app/models/discussion.rb | |
parent | 8934ddbb47d24dac937351588bc28551bd7654e7 (diff) |
Expose comments on Noteables in GraphQL
This exposes `Note`s on Issues & MergeRequests using a
`Types::Notes::NoteableType` in GraphQL.
Exposing notes on a new type can be done by implementing the
`NoteableType` interface on the type. The presented object should
be a `Noteable`.
Diffstat (limited to 'app/models/discussion.rb')
-rw-r--r-- | app/models/discussion.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/models/discussion.rb b/app/models/discussion.rb index 32529ebf71d..ae13cdfd85f 100644 --- a/app/models/discussion.rb +++ b/app/models/discussion.rb @@ -4,6 +4,7 @@ # # A discussion of this type can be resolvable. class Discussion + include GlobalID::Identification include ResolvableDiscussion attr_reader :notes, :context_noteable @@ -11,14 +12,19 @@ class Discussion delegate :created_at, :project, :author, - :noteable, :commit_id, :for_commit?, :for_merge_request?, + :to_ability_name, + :editable?, to: :first_note + def declarative_policy_delegate + first_note + end + def project_id project&.id end |