From b97be4bbf30242c7bd2aba9f40541060cc5bd855 Mon Sep 17 00:00:00 2001 From: Konstantin Haase Date: Tue, 18 Jan 2011 12:58:59 +0100 Subject: [PATCH] Move #l from reporting helper to query utils, so it can be used in filters. --- app/helpers/reporting_helper.rb | 5 ----- app/models/cost_query/query_utils.rb | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/helpers/reporting_helper.rb b/app/helpers/reporting_helper.rb index 875f0f14c1..1a5383f540 100644 --- a/app/helpers/reporting_helper.rb +++ b/app/helpers/reporting_helper.rb @@ -1,11 +1,6 @@ module ReportingHelper include QueriesHelper - def l(*values) - return values.first if values.size == 1 and values.first.respond_to? :to_str - super - end - ## # For a given CostQuery::Filter filter, return an array of hashes, that contain # the partials that should be rendered (:name) for that filter and necessary diff --git a/app/models/cost_query/query_utils.rb b/app/models/cost_query/query_utils.rb index 8766baad20..c3e97d6e3d 100644 --- a/app/models/cost_query/query_utils.rb +++ b/app/models/cost_query/query_utils.rb @@ -14,6 +14,11 @@ module CostQuery::QueryUtils end end + def l(*values) + return values.first if values.size == 1 and values.first.respond_to? :to_str + I18n.t(*values) + end + def user_name(id) # we have no identity map... :( cache[:user_name][id] ||= User.find(id).name