Sha256: 44349407c03f29df4816eb927827ab45b72cb6cab945b88da32d3e4959f7c231
Contents?: true
Size: 974 Bytes
Versions: 71
Compression:
Stored size: 974 Bytes
Contents
# frozen_string_literal: true module Decidim module Debates module Metrics # Searches for Participants in the following actions # - Create a debate (Debates) class DebateParticipantsMetricMeasure < Decidim::MetricMeasure def valid? super && @resource.is_a?(Decidim::Component) end def calculate debates = Decidim::Debates::Debate.where(component: @resource).joins(:component) .where("decidim_debates_debates.created_at <= ?", end_time) .where(decidim_author_type: Decidim::UserBaseEntity.name) .where.not(author: nil) { cumulative_users: debates.pluck(:decidim_author_id), quantity_users: debates.where("decidim_debates_debates.created_at >= ?", start_time).pluck(:decidim_author_id) } end end end end end
Version data entries
71 entries across 71 versions & 1 rubygems