From a6d12299f22e0318f0bea8b4a0192e6c07398b70 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Fri, 17 May 2024 04:29:13 -0400 Subject: [PATCH] Remove duplicate method def `ApplicationHelper#instance_presenter` (#30331) --- app/helpers/application_helper.rb | 4 ++++ app/helpers/mascot_helper.rb | 11 ----------- app/mailers/user_mailer.rb | 1 - 3 files changed, 4 insertions(+), 12 deletions(-) delete mode 100644 app/helpers/mascot_helper.rb diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index eb03f1e4ba..7563ae6105 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -240,6 +240,10 @@ module ApplicationHelper EmojiFormatter.new(html, custom_emojis, other_options.merge(animate: prefers_autoplay?)).to_s end + def mascot_url + full_asset_url(instance_presenter.mascot&.file&.url || frontend_asset_path('images/elephant_ui_plane.svg')) + end + def instance_presenter @instance_presenter ||= InstancePresenter.new end diff --git a/app/helpers/mascot_helper.rb b/app/helpers/mascot_helper.rb deleted file mode 100644 index 34b656411e..0000000000 --- a/app/helpers/mascot_helper.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -module MascotHelper - def mascot_url - full_asset_url(instance_presenter.mascot&.file&.url || frontend_asset_path('images/elephant_ui_plane.svg')) - end - - def instance_presenter - @instance_presenter ||= InstancePresenter.new - end -end diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index f8c1c9a8d0..81a2c0c6d0 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -5,7 +5,6 @@ class UserMailer < Devise::Mailer helper :accounts helper :application - helper :mascot helper :formatting helper :instance helper :routing