]> git.openstreetmap.org Git - rails.git/commitdiff
Remove the report_type helper and use the model_name.human to look up translations.
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 28 Feb 2018 03:40:00 +0000 (11:40 +0800)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 28 Feb 2018 03:40:00 +0000 (11:40 +0800)
app/helpers/issues_helper.rb
app/views/issues/show.html.erb

index 8452cbd608331921246f1c2ce0e3aabe907bf90a..b0e598d7095779d34ce3059cf8702985f35a808e 100644 (file)
@@ -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
index 3bef038005e9223adb367e357f7cd1e17b1b2597..05ce1b9f1f149c047b0b39048b55b8e6d1c9af51 100644 (file)
@@ -1,6 +1,6 @@
 <% content_for :heading do %>
 <h2><%= t ".title", :status => @issue.status.humanize, :issue_id => @issue.id %></h2>
-<p><%= report_type(@issue.reportable_type) %> : <%= reportable_url(@issue.reportable) %></p>
+<p><%= @issue.reportable.model_name.human %> : <%= reportable_url(@issue.reportable) %></p>
 <p class="deemphasize">
   <small>
     <%= @issue.assigned_role %>