diff --git a/app/models/concerns/article.rb b/app/models/concerns/article.rb index f2c11b2b18..614fa2a660 100644 --- a/app/models/concerns/article.rb +++ b/app/models/concerns/article.rb @@ -72,13 +72,13 @@ def create_tag_texts_if_needed module ClassMethods def create_tag_texts_if_needed(team_id, tags) - tags.each do |tag| + tags.to_a.map(&:strip).each do |tag| next if TagText.where(text: tag, team_id: team_id).exists? tag_text = TagText.new tag_text.text = tag tag_text.team_id = team_id tag_text.skip_check_ability = true - tag_text.save! + tag_text.save end end