Sha256: 2f3467279710ec4bf75955ab0095149fed041b45a2e9951a1d73d38a2e32008b

Contents?: true

Size: 692 Bytes

Versions: 1

Compression:

Stored size: 692 Bytes

Contents

require "active_support/core_ext/module/attribute_accessors"
require "active_support/time"
require "groupdate/version"
require "groupdate/magic"

module Groupdate
  PERIODS = [:second, :minute, :hour, :day, :week, :month, :quarter, :year, :day_of_week, :hour_of_day, :day_of_month, :month_of_year]
  # backwards compatibility for anyone who happened to use it
  FIELDS = PERIODS
  METHODS = PERIODS.map { |v| :"group_by_#{v}" }

  mattr_accessor :week_start, :day_start, :time_zone
  self.week_start = :sun
  self.day_start = 0
end

require "groupdate/enumerable"
begin
  require "active_record"
rescue LoadError
  # do nothing
end
require "groupdate/active_record" if defined?(ActiveRecord)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
groupdate-2.5.1 lib/groupdate.rb