更改:项目标记不能清空

This commit is contained in:
yystopf 2023-04-14 11:19:23 +08:00
parent 6eea21821f
commit 71bf2137ac
1 changed files with 1 additions and 1 deletions

View File

@ -132,7 +132,7 @@ class ProjectsController < ApplicationController
# TODO:
# 临时特殊处理修改website、lesson_url操作方法
if project_params.has_key?("website")
if params[:project_topic_names].present? && params[:project_topic_names].is_a?(Array)
if params[:project_topic_names].is_a?(Array)
ProjectTopicRalate.where(project: @project).destroy_all
params[:project_topic_names].each do |name|
project_topic = ProjectTopic.find_or_create_by!(name: name.downcase)