Merge pull request #29 from michihuber/rails4 - reportable - Fork of reportable required by WarVox, from hdm/reportable.
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
---
(DIR) commit 7ab93765296ffddba9b6c4ced20188a5136fc6c3
(DIR) parent c02ee2af6bde90fc905d662e5d754466900a3ada
(HTM) Author: Martin Kvlr <mk@katercalling.com>
Date: Mon, 5 Aug 2013 13:23:07 -0700
Merge pull request #29 from michihuber/rails4
also accept time objects when instantiating reporting periods directly
Diffstat:
M lib/saulabs/reportable/reporting_p… | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
(DIR) diff --git a/lib/saulabs/reportable/reporting_period.rb b/lib/saulabs/reportable/reporting_period.rb
@@ -70,7 +70,7 @@ module Saulabs
# the reporting period for the {Saulabs::Reportable::Grouping} as parsed from the db string
#
def self.from_db_string(grouping, db_string)
- return self.new(grouping, db_string) if db_string.is_a?(Date)
+ return self.new(grouping, db_string) if db_string.is_a?(Date) || db_string.is_a?(Time)
parts = grouping.date_parts_from_db_string(db_string.to_s)
case grouping.identifier
when :hour