X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/aebacc88de18c24c583a12b589eb98cf0b826627..83b42a8b75adbb6bc310a2f23ba1b89a65beffeb:/app/controllers/issues_controller.rb diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 298f7c374..56c0bbdf0 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -45,11 +45,12 @@ class IssuesController < ApplicationController @issues, @newer_issues_id, @older_issues_id = get_page_items(@issues, :limit => @params[:limit]) + @unique_reporters_limit = 3 @unique_reporters = @issues.each_with_object({}) do |issue, reporters| - user_ids = issue.reports.order(:created_at => :desc).pluck(:user_id).uniq + user_ids = issue.reports.reorder(:created_at => :desc).pluck(:user_id).uniq reporters[issue.id] = { :count => user_ids.size, - :users => User.in_order_of(:id, user_ids.first(3)) + :users => User.in_order_of(:id, user_ids.first(@unique_reporters_limit)) } end