When creating a topic, don't select a category by default when allow_uncategorized_topics is false. Also, added category validation on the server to enforce allow_uncategorized_topics.

This commit is contained in:
Neil Lalonde
2013-10-08 14:40:31 -04:00
parent 32af23884e
commit bccb37b6f3
9 changed files with 92 additions and 20 deletions

View File

@ -108,7 +108,7 @@ class TopicsController < ApplicationController
success = false
Topic.transaction do
success = topic.save
topic.change_category(params[:category]) if success
success = topic.change_category(params[:category]) if success
end
# this is used to return the title to the client as it may have been