Commit 6568b08604770cdf0ad0c8807c80a371eab8cb3b

Authored by Andrew Kane
1 parent 98445955

Fixed group_by_period for associations for ActiveRecord < 4

Showing 2 changed files with 2 additions and 2 deletions   Show diff stats
.travis.yml
... ... @@ -10,7 +10,7 @@ gemfile:
10 10 - test/gemfiles/activerecord41.gemfile
11 11 - test/gemfiles/activerecord42.gemfile
12 12 sudo: false
13   -script: bundle exec rake test
  13 +script: RUBYOPT=W0 bundle exec rake test
14 14 before_install:
15 15 - gem install bundler
16 16 - mysql -e 'create database groupdate_test;'
... ...
lib/groupdate.rb
... ... @@ -7,7 +7,7 @@ module Groupdate
7 7 PERIODS = [:second, :minute, :hour, :day, :week, :month, :quarter, :year, :day_of_week, :hour_of_day, :day_of_month, :month_of_year]
8 8 # backwards compatibility for anyone who happened to use it
9 9 FIELDS = PERIODS
10   - METHODS = PERIODS.map { |v| :"group_by_#{v}" }
  10 + METHODS = PERIODS.map { |v| :"group_by_#{v}" } + [:group_by_period]
11 11  
12 12 mattr_accessor :week_start, :day_start, :time_zone, :dates
13 13 self.week_start = :sun
... ...