From b2def1972cb297e555afd57cfdab4419f1755c0a Mon Sep 17 00:00:00 2001 From: Philipp Tessenow Date: Wed, 6 Apr 2011 19:28:11 +0200 Subject: [PATCH] enable filters to know a translation for a given value depending on their available values --- lib/report/filter/base.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/report/filter/base.rb b/lib/report/filter/base.rb index d49bcf0497..43c327ade8 100644 --- a/lib/report/filter/base.rb +++ b/lib/report/filter/base.rb @@ -116,7 +116,11 @@ class Report::Filter end def self.available_values(params = {}) - [] + [] #array of [:label_of_value, value]-kind arrays + end + + def self.label_for_value(value) + available_values(:reverse_search => true).find{ |v| v.second == value || v.second.to_s == value } end def correct_position?