diff --git a/app/controllers/flag_log_controller.rb b/app/controllers/flag_log_controller.rb index 3df9cb04b..92ab63a2d 100644 --- a/app/controllers/flag_log_controller.rb +++ b/app/controllers/flag_log_controller.rb @@ -10,8 +10,11 @@ def index @applicable_flag_logs = FlagLog.auto end - if params[:filter] == 'fps' - @applicable_flag_logs = @applicable_flag_logs.joins(:post).where(:success => true).where(:posts => { :is_tp => false }).where('`posts`.`is_fp` = 1 OR `posts`.`is_naa` = 1') + case params[:filter] + when 'fps' + @applicable_flag_logs = @applicable_flag_logs.joins(:post).where(:success => true).where(:posts => { :is_tp => false }).where('`posts`.`is_fp` = 1 OR `posts`.`is_naa` = 1') + when "failures" + @applicable_flag_logs = @applicable_flag_logs.where(:success => false) end @flag_logs = @applicable_flag_logs.order('flag_logs.created_at DESC, flag_logs.id DESC').includes(:post => [:feedbacks => [:user, :api_key]]).includes(:post => [:reasons]).includes(:user).paginate(:page => params[:page], :per_page => 100) diff --git a/app/views/flag_log/index.html.erb b/app/views/flag_log/index.html.erb index 632c761ae..69bb7fd43 100644 --- a/app/views/flag_log/index.html.erb +++ b/app/views/flag_log/index.html.erb @@ -23,6 +23,7 @@