Parcourir la source

Fix custom emoji category creation silently erroring out on duplicate category (#12647)

Instead, just re-use the existing category if any.

Fixes #12608
master^2
ThibG il y a 4 ans
committed by Eugen Rochko
Parent
révision
c0ed53b810
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. +1
    -1
      app/models/form/custom_emoji_batch.rb

+ 1
- 1
app/models/form/custom_emoji_batch.rb Voir le fichier

@@ -40,7 +40,7 @@ class Form::CustomEmojiBatch
if category_id.present?
CustomEmojiCategory.find(category_id)
elsif category_name.present?
CustomEmojiCategory.create!(name: category_name)
CustomEmojiCategory.find_or_create_by!(name: category_name)
end
end



Chargement…
Annuler
Enregistrer