openSUSE/open-build-service

View on GitHub
src/api/app/components/comment_history_component.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
class CommentHistoryComponent < ApplicationComponent
  include Webui::PaperTrailHelper

  def initialize(comment)
    super

    @comment = comment
  end

  def render?
    policy(@comment).history? && @comment.versions.where(event: 'update').present?
  end
end