Introduction
Introduction Statistics Contact Development Disclaimer Help
fix serialize_conditions method for ruby 1.9.2 - reportable - Fork of reportabl…
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
You are viewing proxied material from jay.scot. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.