fix serialize_conditions method for ruby 1.9.2 - reportable - Fork of reportable required by WarVox, from hdm/reportable.
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
---
(DIR) commit 48a9e90cf35a90c4ba1e06ead786c8056c8daf41
(DIR) parent d63682daf2cbd01653f2a860525cd20f34585220
(HTM) Author: Anton Shemerey <shemerey@gmail.com>
Date: Mon, 14 Mar 2011 15:26:11 +0200
fix serialize_conditions method for ruby 1.9.2
Diffstat:
M lib/saulabs/reportable/report_cach… | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
---
(DIR) diff --git a/lib/saulabs/reportable/report_cache.rb b/lib/saulabs/reportable/report_cache.rb
@@ -115,13 +115,13 @@ module Saulabs
:value => value
)
end
-
+
def self.serialize_conditions(conditions)
- if conditions.is_a?(Array)
+ if conditions.is_a?(Array) && conditions.any?
conditions.join
- elsif conditions.is_a?(Hash)
+ elsif conditions.is_a?(Hash) && conditions.any?
conditions.map.sort{|x,y|x.to_s<=>y.to_s}.flatten.join
- else
+ else
conditions.to_s
end
end