From 6568b08604770cdf0ad0c8807c80a371eab8cb3b Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Mon, 8 Aug 2016 21:01:56 -0700 Subject: [PATCH] Fixed group_by_period for associations for ActiveRecord < 4 --- .travis.yml | 2 +- lib/groupdate.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index eb10358..8d465c9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ gemfile: - test/gemfiles/activerecord41.gemfile - test/gemfiles/activerecord42.gemfile sudo: false -script: bundle exec rake test +script: RUBYOPT=W0 bundle exec rake test before_install: - gem install bundler - mysql -e 'create database groupdate_test;' diff --git a/lib/groupdate.rb b/lib/groupdate.rb index caa6911..f927dd2 100644 --- a/lib/groupdate.rb +++ b/lib/groupdate.rb @@ -7,7 +7,7 @@ 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}" } + METHODS = PERIODS.map { |v| :"group_by_#{v}" } + [:group_by_period] mattr_accessor :week_start, :day_start, :time_zone, :dates self.week_start = :sun -- libgit2 0.21.0