]> cat aescling's git repositories - mastodon.git/commitdiff
Fix audit log error when custom emoji is copied from remote server (#11876)
authorhan@highemelry <high.emerly.ytfin@gmail.com>
Tue, 17 Sep 2019 21:20:48 +0000 (06:20 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Tue, 17 Sep 2019 21:20:48 +0000 (23:20 +0200)
app/models/custom_emoji.rb

index edb1bec7521e85088399a7965c48cc80edb1fc63..0dacaf654bc7c4f78cf074a9b592fc271aba6d59 100644 (file)
@@ -63,7 +63,7 @@ class CustomEmoji < ApplicationRecord
   def copy!
     copy = self.class.find_or_initialize_by(domain: nil, shortcode: shortcode)
     copy.image = image
-    copy.save!
+    copy.tap(&:save!)
   end
 
   class << self