From: Andy Allan Date: Wed, 28 Feb 2018 03:40:00 +0000 (+0800) Subject: Remove the report_type helper and use the model_name.human to look up translations. X-Git-Tag: live~2976^2~53 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/38efcc2f33066ae86f16313c40e0562e42acdbe1?ds=sidebyside Remove the report_type helper and use the model_name.human to look up translations. --- diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 8452cbd60..b0e598d70 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -46,19 +46,4 @@ module IssuesHelper link_to "Show Instance", :controller => :browse, :action => :note, :id => reportable.id end end - - def report_type(report_class) - case report_class - when "DiaryEntry" - t("activerecord.models.diary_entry") - when "User" - t("activerecord.models.user") - when "DiaryComment" - t("activerecord.models.diary_comment") - when "Changeset" - t("activerecord.models.changeset") - when "Note" - t("activerecord.models.note") - end - end end diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb index 3bef03800..05ce1b9f1 100644 --- a/app/views/issues/show.html.erb +++ b/app/views/issues/show.html.erb @@ -1,6 +1,6 @@ <% content_for :heading do %>

<%= t ".title", :status => @issue.status.humanize, :issue_id => @issue.id %>

-

<%= report_type(@issue.reportable_type) %> : <%= reportable_url(@issue.reportable) %>

+

<%= @issue.reportable.model_name.human %> : <%= reportable_url(@issue.reportable) %>

<%= @issue.assigned_role %>