From 1d05c873e8c2dc6aa1e2874d86c6e2e1fe9c3504 Mon Sep 17 00:00:00 2001 From: Tim Felgentreff Date: Fri, 15 Jul 2011 10:38:10 +0200 Subject: [PATCH] fix ReportingHelper definition of l() --- app/helpers/reporting_helper.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/helpers/reporting_helper.rb b/app/helpers/reporting_helper.rb index 2569371483..1953eab56c 100644 --- a/app/helpers/reporting_helper.rb +++ b/app/helpers/reporting_helper.rb @@ -6,13 +6,14 @@ module ReportingHelper # include QueriesHelper include ApplicationHelper + # Extends the definition in ApplicationHelper, to allow passing Dates as well + # This is the definitions that is hit by the views and widgets def l(*values) return values.first if values.size == 1 and values.first.respond_to? :to_str - symbol_or_date = values.first - if [Date, DateTime, Time].include? symbol_or_date.class - ::I18n.l symbol_or_date + if [Date, DateTime, Time].include? values.first.class + ::I18n.l values.first else - ::I18n.t symbol_or_date.to_sym, :default => symbol_or_date.to_s.humanize + ApplicationHelper.l(*values) end end