Sha256: 8e9222c5149414dd5cf4751f1063f6e52954f2f406a6e39c6940222497d9915c

Contents?: true

Size: 686 Bytes

Versions: 8

Compression:

Stored size: 686 Bytes

Contents

# frozen_string_literal: true
module Hyrax
  module Statistics
    module Users
      class OverTime < Statistics::OverTime
        # Overridden to do a noncumulative query
        def points
          Enumerator.new(size) do |y|
            x = @x_min
            while x <= @x_max
              bottom = x
              x += @delta_x.days
              y.yield [@x_output.call(x), point(bottom, x)]
            end
          end
        end

        private

        def relation
          ::User.registered
        end

        # Override to make an activerecord date range query
        def query(min, max)
          { created_at: min..max }
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
hyrax-3.2.0 app/services/hyrax/statistics/users/over_time.rb
hyrax-3.1.0 app/services/hyrax/statistics/users/over_time.rb
hyrax-3.0.2 app/services/hyrax/statistics/users/over_time.rb
hyrax-3.0.1 app/services/hyrax/statistics/users/over_time.rb
hyrax-3.0.0 app/services/hyrax/statistics/users/over_time.rb
hyrax-3.0.0.pre.rc4 app/services/hyrax/statistics/users/over_time.rb
hyrax-3.0.0.pre.rc3 app/services/hyrax/statistics/users/over_time.rb
hyrax-3.0.0.pre.rc2 app/services/hyrax/statistics/users/over_time.rb