Sha256: 8d68a4cb288f202f2fc8553b0a50b9048a662488fa3f142d34afd53075ab877a

Contents?: true

Size: 724 Bytes

Versions: 22

Compression:

Stored size: 724 Bytes

Contents

# frozen_string_literal: true

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

      private

      def query
        @query ||= Decidim::User.where(organization: @organization)
                                .where("deleted_at IS NULL OR deleted_at > ?", end_time)
                                .where("blocked_at IS NULL OR blocked_at > ?", end_time)
                                .confirmed
                                .where("created_at <= ?", end_time)
      end

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

Version data entries

22 entries across 22 versions & 1 rubygems

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