compare date objects directly instead of converting them to strings. This fixes the very slow comparision in rails using I18n.localize - reportable - Fork of reportable required by WarVox, from hdm/reportable.
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
---
(DIR) commit b3aba348ac6681628df83c23f0ac038daac16a69
(DIR) parent 1d774153ecd40e3bc00bb6e0ac18501bdf9350b2
(HTM) Author: Lars Kuhnt <lars.kuhnt@gmail.com>
Date: Mon, 26 Apr 2010 19:00:55 +0200
compare date objects directly instead of converting them to strings. This fixes the very slow comparision in rails using I18n.localize
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
@@ -111,7 +111,7 @@ module Saulabs
#
def ==(other)
if other.is_a?(Saulabs::Reportable::ReportingPeriod)
- @date_time.to_s == other.date_time.to_s && @grouping.identifier.to_s == other.grouping.identifier.to_s
+ @date_time == other.date_time && @grouping.identifier.to_s == other.grouping.identifier.to_s
elsif other.is_a?(Time) || other.is_a?(DateTime)
@date_time == parse_date_time(other)
else