Class: MergeRequestsClosingIssues

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

Constant Summary

Constants inherited from ApplicationRecord

ApplicationRecord::MAX_PLUCK

Class Method Summary collapse

Methods inherited from ApplicationRecord

cached_column_list, #create_or_load_association, declarative_enum, default_select_columns, id_in, id_not_in, iid_in, pluck_primary_key, primary_key_in, #readable_by?, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, #to_ability_name, underscore, where_exists, where_not_exists, with_fast_read_statement_timeout, without_order

Methods included from SensitiveSerializableHash

#serializable_hash

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