Commit 8ecbb86e5ea54b80fce462d8d61ae0201aa925db

Authored by Andrew Kane
1 parent 3181c9a6

Added option

Showing 2 changed files with 6 additions and 1 deletions   Show diff stats
  1 +## 3.1.2 [unreleased]
  2 +
  3 +- Added `debug_time_zone_support` option
  4 +
1 ## 3.1.1 5 ## 3.1.1
2 6
3 - Fixed `current: false` 7 - Fixed `current: false`
lib/groupdate/magic.rb
@@ -147,7 +147,8 @@ module Groupdate @@ -147,7 +147,8 @@ module Groupdate
147 count = 147 count =
148 begin 148 begin
149 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] }] 149 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] }]
150 - rescue NoMethodError 150 + rescue NoMethodError => e
  151 + raise e if options[:debug_time_zone_support]
151 raise "Be sure to install time zone support - https://github.com/ankane/groupdate#for-mysql" 152 raise "Be sure to install time zone support - https://github.com/ankane/groupdate#for-mysql"
152 end 153 end
153 154