Move #l from reporting helper to query utils, so it can be used in filters.

pull/6827/head
Konstantin Haase 14 years ago
parent ef3eb06afe
commit b97be4bbf3
  1. 5
      app/helpers/reporting_helper.rb
  2. 5
      app/models/cost_query/query_utils.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

@ -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

Loading…
Cancel
Save