diff options
author | David Yip <yipdw@member.fsf.org> | 2017-11-17 14:35:16 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-17 14:35:16 -0600 |
commit | 6f8ccbfcdf7fd8ca651d1583a608e96b25a09e25 (patch) | |
tree | 12b704c2db10feec59787cbeeba6fdc89d21e513 /app/controllers | |
parent | b006bb82afb360d64e9d2f7f12aa76d4a69a2397 (diff) | |
parent | 94c5a11cdaebee605f379f66ab57306523b5f148 (diff) |
Merge pull request #222 from yipdw/merge/tootsuite/master
Merge upstream (e28b33c.. 94c5a11)
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/admin/custom_emojis_controller.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/controllers/admin/custom_emojis_controller.rb b/app/controllers/admin/custom_emojis_controller.rb index 693d28b1f..509f7a48f 100644 --- a/app/controllers/admin/custom_emojis_controller.rb +++ b/app/controllers/admin/custom_emojis_controller.rb @@ -45,9 +45,10 @@ module Admin def copy authorize @custom_emoji, :copy? - emoji = CustomEmoji.find_or_create_by(domain: nil, shortcode: @custom_emoji.shortcode) + emoji = CustomEmoji.find_or_initialize_by(domain: nil, shortcode: @custom_emoji.shortcode) + emoji.image = @custom_emoji.image - if emoji.update(image: @custom_emoji.image) + if emoji.save flash[:notice] = I18n.t('admin.custom_emojis.copied_msg') else flash[:alert] = I18n.t('admin.custom_emojis.copy_failed_msg') |