Class: Gitlab::BackgroundMigration::PopulatePersonalSnippetStatistics

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/background_migration/populate_personal_snippet_statistics.rb

Overview

This class creates/updates those personal snippets statistics that haven't been created nor initialized. It also updates the related root storage namespace stats

Instance Method Summary collapse

Instance Method Details

#perform(snippet_ids) ⇒ Object


9
10
11
12
13
14
# File 'lib/gitlab/background_migration/populate_personal_snippet_statistics.rb', line 9

def perform(snippet_ids)
  personal_snippets(snippet_ids).group_by(&:author).each do |author, author_snippets|
    upsert_snippet_statistics(author_snippets)
    update_namespace_statistics(author.namespace)
  end
end