From 784c5832cfaef4f6584cfbf3d0830ae0f6683974 Mon Sep 17 00:00:00 2001 From: Absurdon Date: Sun, 2 Jul 2017 22:48:33 +0200 Subject: [PATCH] fixed issues with NULL category not showing --- app/controllers/issues_controller.rb | 7 ++++--- app/models/issue.rb | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 40a3185..36343bf 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -13,10 +13,11 @@ class IssuesController < ApplicationController end allowed = Issue::allowed_categories cuser + qstring = "category_id IN (?) OR category_id IS NULL" - @open = Issue.where(category_id: allowed).with_status(Issue::STATUS_OPEN).all order: sort - @solved = Issue.where(category_id: allowed).with_status(Issue::STATUS_SOLVED).all order: sort - @rejected = Issue.where(category_id: allowed).with_status(Issue::STATUS_REJECTED).all order: sort + @open = Issue.where(qstring, allowed).with_status(Issue::STATUS_OPEN).all order: sort + @solved = Issue.where(qstring, allowed).with_status(Issue::STATUS_SOLVED).all order: sort + @rejected = Issue.where(qstring, allowed).with_status(Issue::STATUS_REJECTED).all order: sort end def show diff --git a/app/models/issue.rb b/app/models/issue.rb index 5087278..0bf039b 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -27,7 +27,7 @@ class Issue < ActiveRecord::Base CATEGORY_WEBSITE = 17 CATEGORY_NSLPLUGIN = 20 CATEGORY_LEAGUE = 22 - CATEGORY_GATHER = 52 + CATEGORY_GATHER = 54 attr_accessor :assigned_name attr_protected :id, :created_at, :updated_at