From: Andy Allan Date: Fri, 23 Feb 2018 02:18:57 +0000 (+0800) Subject: resolve last_reported_by vs last_updated_by duplication X-Git-Tag: live~2953^2~58 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/7b5e0d91f3c98e593f939225646f60f246af27f0 resolve last_reported_by vs last_updated_by duplication --- diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 75eb3dd3a..7f455b9e9 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -38,17 +38,11 @@ class IssuesController < ApplicationController @issues = @issues.where(:reportable_type => params[:issue_type][0]) end - # If last_updated_by if params[:last_updated_by] && params[:last_updated_by][0].present? last_updated_by = params[:last_updated_by][0].to_s == "nil" ? nil : params[:last_updated_by][0].to_i @issues = @issues.where(:updated_by => last_updated_by) end - if params[:last_reported_by] && params[:last_reported_by][0].present? - last_reported_by = params[:last_reported_by][0].to_s == "nil" ? nil : params[:last_reported_by][0].to_i - @issues = @issues.where(:updated_by => last_reported_by) - end - redirect_to issues_path, :notice => notice if notice end diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb index 4a6cf3c9a..56de810c2 100644 --- a/app/views/issues/index.html.erb +++ b/app/views/issues/index.html.erb @@ -7,7 +7,7 @@ <%= select :status, nil, [['open', 0], ['resolved', 2], ['ignored', 1]], { :include_blank => t(".select_status")}, data: { behavior: 'category_dropdown' } %> <%= select :issue_type, nil, @issue_types, { :include_blank => t(".select_type")}, data: { behavior: 'category_dropdown' } %> <%= text_field_tag :search_by_user, params[:search_by_user], placeholder: t(".reported_user") %> -<%= select :last_reported_by, nil, @users.all.collect {|f| [f.display_name, f.id]} << [ t(".not_updated"), "nil"], { :include_blank => t(".select_last_updated_by")}, data: { behavior: 'category_dropdown' } %> +<%= select :last_updated_by, nil, @users.all.collect {|f| [f.display_name, f.id]} << [ t(".not_updated"), "nil"], { :include_blank => t(".select_last_updated_by")}, data: { behavior: 'category_dropdown' } %> <%= submit_tag t(".search") %> <% end %>