From 8ecbb86e5ea54b80fce462d8d61ae0201aa925db Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Sun, 8 Jan 2017 18:58:24 -0800 Subject: [PATCH] Added option --- CHANGELOG.md | 4 ++++ lib/groupdate/magic.rb | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3c3df5..cd98b07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.1.2 [unreleased] + +- Added `debug_time_zone_support` option + ## 3.1.1 - Fixed `current: false` diff --git a/lib/groupdate/magic.rb b/lib/groupdate/magic.rb index 27d6542..5846b44 100644 --- a/lib/groupdate/magic.rb +++ b/lib/groupdate/magic.rb @@ -147,7 +147,8 @@ module Groupdate count = begin Hash[relation.send(method, *args, &block).map { |k, v| [multiple_groups ? k[0...@group_index] + [cast_method.call(k[@group_index])] + k[(@group_index + 1)..-1] : cast_method.call(k), v] }] - rescue NoMethodError + rescue NoMethodError => e + raise e if options[:debug_time_zone_support] raise "Be sure to install time zone support - https://github.com/ankane/groupdate#for-mysql" end -- libgit2 0.21.0