From b55994f824a0815f2d70ce9d85a88bfe16f46535 Mon Sep 17 00:00:00 2001 From: Milan Zazrivec Date: Wed, 9 Oct 2019 15:32:44 +0200 Subject: [PATCH] ChargebackRateDetail: Apply gettext to model constants --- app/controllers/chargeback_controller.rb | 2 +- app/views/chargeback/_tier_first_row.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/chargeback_controller.rb b/app/controllers/chargeback_controller.rb index b1831fdcc4b..e54fd46f894 100644 --- a/app/controllers/chargeback_controller.rb +++ b/app/controllers/chargeback_controller.rb @@ -542,7 +542,7 @@ def cb_rate_set_form_vars @edit[:new][:details].push(temp) end - @edit[:new][:per_time_types] = ChargebackRateDetail::PER_TIME_TYPES + @edit[:new][:per_time_types] = ChargebackRateDetail::PER_TIME_TYPES.map { |x, y| [x, _(y)] }.to_h if params[:pressed] == 'chargeback_rates_copy' @rate.id = nil diff --git a/app/views/chargeback/_tier_first_row.haml b/app/views/chargeback/_tier_first_row.haml index ab977e5418f..b6783ffdfad 100644 --- a/app/views/chargeback/_tier_first_row.haml +++ b/app/views/chargeback/_tier_first_row.haml @@ -16,7 +16,7 @@ = r[:sub_metric_human] %td{:rowspan => n.to_s} = select_tag("per_time_#{i}", - options_for_select(ChargebackRateDetail::PER_TIME_TYPES.invert, @edit[:new][:details][i.to_i][:per_time]), + options_for_select(ChargebackRateDetail::PER_TIME_TYPES.map { |x, y| [x, _(y)] }.to_h.invert, @edit[:new][:details][i.to_i][:per_time]), "data-miq_observe" => {:url => url}.to_json) - measure = @edit[:new][:details][i.to_i][:detail_measure] - if measure.nil?