Sha256: d8e5e35ba65024999f356301ec5c8f0295ab18c97d41315edb299471a40ca75b

Contents?: true

Size: 386 Bytes

Versions: 64

Compression:

Stored size: 386 Bytes

Contents

# frozen_string_literal: true

module Decidim
  class MetricJob < ApplicationJob
    queue_as :metrics

    def perform(manager_class, organization_id, day = nil)
      organization = Decidim::Organization.find_by(id: organization_id)
      return unless organization

      metric = manager_class.constantize.new(day, organization)
      metric.save if metric.valid?
    end
  end
end

Version data entries

64 entries across 64 versions & 1 rubygems

Version Path
decidim-core-0.29.1 app/jobs/decidim/metric_job.rb
decidim-core-0.28.4 app/jobs/decidim/metric_job.rb
decidim-core-0.27.9 app/jobs/decidim/metric_job.rb
decidim-core-0.29.0 app/jobs/decidim/metric_job.rb
decidim-core-0.28.3 app/jobs/decidim/metric_job.rb
decidim-core-0.27.8 app/jobs/decidim/metric_job.rb
decidim-core-0.29.0.rc4 app/jobs/decidim/metric_job.rb
decidim-core-0.29.0.rc3 app/jobs/decidim/metric_job.rb
decidim-core-0.29.0.rc2 app/jobs/decidim/metric_job.rb
decidim-core-0.29.0.rc1 app/jobs/decidim/metric_job.rb
decidim-core-0.28.2 app/jobs/decidim/metric_job.rb
decidim-core-0.27.7 app/jobs/decidim/metric_job.rb
decidim-core-0.28.1 app/jobs/decidim/metric_job.rb
decidim-core-0.27.6 app/jobs/decidim/metric_job.rb
decidim-core-0.26.10 app/jobs/decidim/metric_job.rb
decidim-core-0.26.9 app/jobs/decidim/metric_job.rb
decidim-core-0.28.0 app/jobs/decidim/metric_job.rb
decidim-core-0.27.5 app/jobs/decidim/metric_job.rb
decidim-core-0.28.0.rc5 app/jobs/decidim/metric_job.rb
decidim-core-0.28.0.rc4 app/jobs/decidim/metric_job.rb