diff options
author | Paul Slaughter <pslaughter@gitlab.com> | 2018-10-03 09:44:18 +0300 |
---|---|---|
committer | Paul Slaughter <pslaughter@gitlab.com> | 2018-10-03 21:18:20 +0300 |
commit | 5a286eb7a3a0c395d35c722ce6a067aca47473f2 (patch) | |
tree | 1eb9364a353cf0dca945e073f7b7f74b246307f2 /app/serializers/commit_entity.rb | |
parent | c375171bfd4b25d8cf4d7a95e2c65c655c7d647c (diff) |
Add signature badge to diffs/commit_item
**Notes:**
- Also exposes commit.signature_html in diffs.json
Diffstat (limited to 'app/serializers/commit_entity.rb')
-rw-r--r-- | app/serializers/commit_entity.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/serializers/commit_entity.rb b/app/serializers/commit_entity.rb index 396e95a03c8..90406701bbb 100644 --- a/app/serializers/commit_entity.rb +++ b/app/serializers/commit_entity.rb @@ -25,4 +25,14 @@ class CommitEntity < API::Entities::Commit expose :title_html, if: { type: :full } do |commit| markdown_field(commit, :title) end + + expose :signature_html, if: { type: :full } do |commit| + render('projects/commit/_signature', signature: commit.signature) if commit.has_signature? + end + + def render(*args) + return unless request.respond_to?(:render) && request.render.respond_to?(:call) + + request.render.call(*args) + end end |