#46 Add Prometheus exporter

This commit is contained in:
Tobias Kantusch
2021-02-18 18:02:56 +01:00
committed by Sebastian Serth
parent 39fcd255f9
commit 44b32b6f6a
26 changed files with 2121 additions and 45 deletions

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
class Comment < ApplicationRecord
# inherit the creation module: encapsulates that this is a polymorphic user, offers some aliases and makes sure that all necessary attributes are set.
include Creation
@ -8,4 +10,12 @@ class Comment < ApplicationRecord
belongs_to :file, class_name: 'CodeOcean::File'
belongs_to :user, polymorphic: true
# after_save :trigger_rfc_action_cable_from_comment
def request_for_comment
RequestForComment.find_by(submission_id: file.context.id)
end
def only_comment_for_rfc?
request_for_comment.comments.one?
end
end