fix serialize_conditions method for ruby 1.9.2 - reportable - Unnamed repositor… | |
Log | |
Files | |
Refs | |
README | |
--- | |
commit 48a9e90cf35a90c4ba1e06ead786c8056c8daf41 | |
parent d63682daf2cbd01653f2a860525cd20f34585220 | |
Author: Anton Shemerey <[email protected]> | |
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(-) | |
--- | |
diff --git a/lib/saulabs/reportable/report_cache.rb b/lib/saulabs/reportable/re… | |
@@ -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 |