prevent users from ever changing the category of a topic in a support category

This commit is contained in:
Régis Hanol
2015-11-25 19:40:47 +01:00
parent 578e15224b
commit e8a6ff4808
2 changed files with 13 additions and 0 deletions

View File

@@ -540,6 +540,7 @@ class Topic < ActiveRecord::Base
def change_category_to_id(category_id)
return false if private_message?
return false if category.try(:is_support)
new_category_id = category_id.to_i
# if the category name is blank, reset the attribute