lib/groupdate/scopes.rb in groupdate-1.0.4 vs lib/groupdate/scopes.rb in groupdate-1.0.5
- old
+ new
@@ -9,10 +9,10 @@
(time_fields + number_fields).each do |field|
define_method :"group_by_#{field}" do |*args|
args = args.dup
options = args[-1].is_a?(Hash) ? args.pop : {}
column = connection.quote_table_name(args[0])
- time_zone = args[1] || Time.zone || "Etc/UTC"
+ time_zone = args[1] || Groupdate.time_zone || Time.zone || "Etc/UTC"
if time_zone.is_a?(ActiveSupport::TimeZone) or time_zone = ActiveSupport::TimeZone[time_zone]
time_zone = time_zone.tzinfo.name
else
raise "Unrecognized time zone"
end