1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-05 16:24:21 +01:00
fab-manager/app/services/statistics/builders/projects_builder_service.rb
Sylvain b7af29c1a8 (bug) unable to build stats
NoMethodError: undefined method `date' for #<Hash>
app/services/statistics/builders/projects_builder_service.rb:12:in `block in build'
2022-09-05 16:29:01 +02:00

20 lines
660 B
Ruby

# frozen_string_literal: true
# Generate statistics indicators about projects
class Statistics::Builders::ProjectsBuilderService
include Statistics::Concerns::HelpersConcern
include Statistics::Concerns::ProjectsConcern
class << self
def build(options = default_options)
# project list
Statistics::FetcherService.projects_list(options).each do |p|
Stats::Project.create({ date: format_date(p[:date]),
type: 'project',
subType: 'published',
stat: 1 }.merge(user_info_stat(p)).merge(project_info_stat(p)))
end
end
end
end