summaryrefslogtreecommitdiff
path: root/app/services/projects/update_statistics_service.rb
blob: 28677a398f3f5e7db69c1befcfc4f92b1ee40dc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

module Projects
  class UpdateStatisticsService < BaseService
    def execute
      return unless project

      Rails.logger.info("Updating statistics for project #{project.id}")

      project.statistics.refresh!(only: statistics.map(&:to_sym))
    end

    private

    def statistics
      params[:statistics]
    end
  end
end