This website works better with JavaScript.
Home
Explore
Help
Sign In
closed-social
/
mastodon
Watch
3
Star
0
Fork
2
Code
Issues
5
Pull Requests
0
Projects
0
Releases
3
Wiki
Activity
Browse 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
ThibG
4 years ago
committed by
Eugen Rochko
parent
fb9137752a
commit
c0ed53b810
1 changed files
with
1 additions
and
1 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+1
-1
app/models/form/custom_emoji_batch.rb
+ 1
- 1
app/models/form/custom_emoji_batch.rb
View File
@ -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
Write
Preview
Loading…
Cancel
Save