Sha256: 95dc9fccde30916fc699da7ec794d19d6e31a3ae74c97b1023ee6e9cb79be82a

Contents?: true

Size: 658 Bytes

Versions: 50

Compression:

Stored size: 658 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Metrics
    # Metric manager for User's registries
    class ReportedUsersMetricManage < Decidim::MetricManage
      def metric_name
        "reported_users"
      end

      private

      def query
        return @query if @query

        @query = Decidim::User.where(organization: @organization).joins(:user_moderation)
        @query = @query.where("#{Decidim::UserModeration.table_name}.created_at <= ?", end_time)
        @query
      end

      def quantity
        @quantity ||= @query.where("#{Decidim::UserModeration.table_name}.created_at >= ?", start_time).count
      end
    end
  end
end

Version data entries

50 entries across 50 versions & 1 rubygems

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