Sha256: 144a570b6f46927ff445096d7d8e33c16f3b9aaca6115b12ccb63d3639f6a39b

Contents?: true

Size: 591 Bytes

Versions: 2

Compression:

Stored size: 591 Bytes

Contents

# frozen_string_literal: true
module GroupMetrics
  # Tabulate count of Activities (within a study week) for a Group.
  class WeeklyActivitiesCount < WeeklyCount
    self.table_name = "activities"

    scope :in_the_past, lambda {
      where arel_table[:end_time].lt(Time.zone.now)
    }

    # To Do: fix naming and/or what is going on here
    # change to start_time and is_scheduled
    # and updated tests
    scope :unscheduled_or_in_the_future, lambda {
      where(
        arel_table[:start_time].eq(nil)
        .or(arel_table[:end_time].gt(Time.zone.now))
      )
    }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
think_feel_do_engine-3.21.0 app/models/group_metrics/weekly_activities_count.rb
think_feel_do_engine-3.20.1 app/models/group_metrics/weekly_activities_count.rb