X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/5c551d475fa2e055e4b644c26bd7ca8f99b748a1..b03eb84bb640fd5afbff0a899b3afbce34df3ed9:/app/helpers/reports_helper.rb diff --git a/app/helpers/reports_helper.rb b/app/helpers/reports_helper.rb index f9cc99621..57b786792 100644 --- a/app/helpers/reports_helper.rb +++ b/app/helpers/reports_helper.rb @@ -1,6 +1,8 @@ require "ostruct" module ReportsHelper + Category = Struct.new(:id, :label) + def report_link(name, reportable) link_to name, new_report_url(:reportable_id => reportable.id, :reportable_type => reportable.class.name) end @@ -8,7 +10,7 @@ module ReportsHelper # Convert a list of strings into objects with methods that the collection_radio_buttons helper expects def report_categories(reportable) Report.categories_for(reportable).map do |c| - OpenStruct.new(:id => c, :label => t(".categories.#{reportable.class.name.underscore}.#{c}_label")) + Category.new(c, t(".categories.#{reportable.class.name.underscore}.#{c}_label")) end end end