]> cat aescling's git repositories - mastodon.git/commitdiff
Fix custom emoji copy not copying file (#5298)
authorEugen Rochko <eugen@zeonfederated.com>
Tue, 10 Oct 2017 13:18:27 +0000 (15:18 +0200)
committerGitHub <noreply@github.com>
Tue, 10 Oct 2017 13:18:27 +0000 (15:18 +0200)
app/controllers/admin/custom_emojis_controller.rb

index dba9f10123683cb4ae128396727676c613942b5d..ca81f325510dd8e6541c2e0d72b3e369ecbd4170 100644 (file)
@@ -28,8 +28,7 @@ module Admin
     end
 
     def copy
-      emoji = @custom_emoji.dup
-      emoji.domain = nil
+      emoji = CustomEmoji.new(domain: nil, shortcode: @custom_emoji.shortcode, image: @custom_emoji.image)
 
       if emoji.save
         redirect_to admin_custom_emojis_path, notice: I18n.t('admin.custom_emojis.copied_msg')