Sha256: d970b3cafc4c0ece30822c77e5cfb20c99d68c27c5627bb367f7b978754b60a8

Contents?: true

Size: 564 Bytes

Versions: 50

Compression:

Stored size: 564 Bytes

Contents

# frozen_string_literal: true

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

      private

      def query
        return @query if @query

        @query = Decidim::User.blocked.where(organization: @organization)
        @query = @query.where("blocked_at <= ?", end_time)
        @query
      end

      def quantity
        @quantity ||= @query.where("blocked_at >= ?", start_time).count
      end
    end
  end
end

Version data entries

50 entries across 50 versions & 1 rubygems

Version Path
decidim-core-0.26.8 app/queries/decidim/metrics/blocked_users_metric_manage.rb
decidim-core-0.27.4 app/queries/decidim/metrics/blocked_users_metric_manage.rb
decidim-core-0.27.3 app/queries/decidim/metrics/blocked_users_metric_manage.rb
decidim-core-0.26.7 app/queries/decidim/metrics/blocked_users_metric_manage.rb
decidim-core-0.26.5 app/queries/decidim/metrics/blocked_users_metric_manage.rb
decidim-core-0.27.2 app/queries/decidim/metrics/blocked_users_metric_manage.rb
decidim-core-0.27.1 app/queries/decidim/metrics/blocked_users_metric_manage.rb
decidim-core-0.26.4 app/queries/decidim/metrics/blocked_users_metric_manage.rb
decidim-core-0.27.0 app/queries/decidim/metrics/blocked_users_metric_manage.rb
decidim-core-0.26.3 app/queries/decidim/metrics/blocked_users_metric_manage.rb
decidim-core-0.27.0.rc2 app/queries/decidim/metrics/blocked_users_metric_manage.rb
decidim-core-0.27.0.rc1 app/queries/decidim/metrics/blocked_users_metric_manage.rb
decidim-core-0.26.2 app/queries/decidim/metrics/blocked_users_metric_manage.rb
decidim-core-0.26.1 app/queries/decidim/metrics/blocked_users_metric_manage.rb
decidim-core-0.26.0 app/queries/decidim/metrics/blocked_users_metric_manage.rb
decidim-core-0.26.0.rc2 app/queries/decidim/metrics/blocked_users_metric_manage.rb
decidim-core-0.26.0.rc1 app/queries/decidim/metrics/blocked_users_metric_manage.rb
decidim-core-0.25.2 app/queries/decidim/metrics/blocked_users_metric_manage.rb
decidim-core-0.25.1 app/queries/decidim/metrics/blocked_users_metric_manage.rb
decidim-core-0.25.0 app/queries/decidim/metrics/blocked_users_metric_manage.rb