Class: MergeRequestsClosingIssues

Inherits:
ApplicationRecord show all
Defined in:
app/models/merge_requests_closing_issues.rb

Class Method Summary collapse

Methods inherited from ApplicationRecord

at_most, id_in, id_not_in, iid_in, pluck_primary_key, primary_key_in, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, underscore, without_order

Class Method Details

.count_for_collection(ids, current_user) ⇒ Object


27
28
29
# File 'app/models/merge_requests_closing_issues.rb', line 27

def count_for_collection(ids, current_user)
  closing_merge_requests(ids, current_user).group(:issue_id).pluck('issue_id', Arel.sql('COUNT(*) as count'))
end

.count_for_issue(id, current_user) ⇒ Object


31
32
33
# File 'app/models/merge_requests_closing_issues.rb', line 31

def count_for_issue(id, current_user)
  closing_merge_requests(id, current_user).count
end