Class: Hubstats::QaSignoff

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/hubstats/qa_signoff.rb

Class Method Summary collapse

Class Method Details

.first_or_create(repo_id, pr_id, user_id) ⇒ Object

Public - Makes a new QA Signoff with the data that is passed in.

repo_id - the id of the repository pr_id - the id of the pull request user_id - the id of the user who added the label

Returns - the QA Signoff



30
31
32
33
34
35
36
# File 'app/models/hubstats/qa_signoff.rb', line 30

def self.first_or_create(repo_id, pr_id, user_id)
  QaSignoff.create(user_id: user_id,
                   repo_id: repo_id,
                   pull_request_id: pr_id,
                   label_name: 'qa-approved',
                   signed_at: Time.now.getutc)
end

.record_timestampsObject



4
# File 'app/models/hubstats/qa_signoff.rb', line 4

def self.record_timestamps; false; end

.remove_signoff(repo_id, pr_id) ⇒ Object

Public - Deletes the QA Signoff of the PR that is passed in.

repo_id - the id of the repository the PR belongs to pr_id - the id of the PR the signoff was deleted from

Returns - the deleted QA Signoff



44
45
46
47
# File 'app/models/hubstats/qa_signoff.rb', line 44

def self.remove_signoff(repo_id, pr_id)
  signoff = Hubstats::QaSignoff.where(repo_id: repo_id).where(pull_request_id: pr_id).first
  signoff.destroy if signoff
end