Revert "Merge pull request #1215 from Elegios/composer_use_category_id"

This reverts commit 763859d4396f406352c4901502a8c33430e54cb2, reversing
changes made to b62caf80fbb81ea7a8ece5632513fcc8559db0e1.
This commit is contained in:
Robin Ward
2013-09-06 18:00:57 -04:00
parent a9f3489237
commit c8ad977c8a
5 changed files with 18 additions and 18 deletions

View File

@ -39,14 +39,7 @@ class TopicCreator
topic_params[:archetype] = @opts[:archetype] if @opts[:archetype].present?
topic_params[:subtype] = @opts[:subtype] if @opts[:subtype].present?
# Temporary fix to allow older clients to create topics.
# When all clients are updated the category variable should
# be set directly to the contents of the if statement.
category = if @opts[:category].is_a? Integer || @opts[:category] =~ /^\d+$/
Category.where(id: @opts[:category]).first
else
Category.where(name: @opts[:category]).first
end
category = Category.where(name: @opts[:category]).first
@guardian.ensure_can_create!(Topic,category)
topic_params[:category_id] = category.id if category.present?