From d181041ae29fb790cdaab16c1df3ee98eb110f50 Mon Sep 17 00:00:00 2001 From: Jeremy Friesen Date: Mon, 4 Apr 2022 16:05:53 -0400 Subject: [PATCH] =?UTF-8?q?Removing=20uncalled=20method=20=E2=9C=82?= =?UTF-8?q?=E2=9C=82=E2=9C=82=20(#17110)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Introduced in forem/forem#3176, it appears that this method has been along for the ride. How did I find this? I saw an exception and realized that we cast our comment IDs from base-26 integer format to base-10. I decided to look through our code for `/\.to_\w\(26\)/` and stumbled upon the now removed instance. Quickly looking at the code, it appeared that this method was never called. So ✂✂✂ --- app/liquid_tags/poll_tag.rb | 6 ------ config/locales/liquid_tags/en.yml | 2 -- config/locales/liquid_tags/fr.yml | 2 -- 3 files changed, 10 deletions(-) diff --git a/app/liquid_tags/poll_tag.rb b/app/liquid_tags/poll_tag.rb index af23de090..fc51dcd8a 100644 --- a/app/liquid_tags/poll_tag.rb +++ b/app/liquid_tags/poll_tag.rb @@ -120,12 +120,6 @@ class PollTag < LiquidTagBase ) end - def find_poll(id_code) - Poll.find(id_code.to_i(26)) - rescue ActiveRecord::RecordNotFound - raise StandardError, I18n.t("liquid_tags.poll_tag.invalid_poll_id") - end - def self.script SCRIPT end diff --git a/config/locales/liquid_tags/en.yml b/config/locales/liquid_tags/en.yml index 2e36db1ff..399a5ab2a 100644 --- a/config/locales/liquid_tags/en.yml +++ b/config/locales/liquid_tags/en.yml @@ -64,8 +64,6 @@ en: invalid_parler_url: Invalid Parler URL podcast_tag: invalid_podcast_link: Invalid podcast link - poll_tag: - invalid_poll_id: Invalid poll ID reddit_tag: invalid_reddit_link: 'Invalid Reddit link: %{url}' replit_tag: diff --git a/config/locales/liquid_tags/fr.yml b/config/locales/liquid_tags/fr.yml index 1f3d36088..a7e7f8f45 100644 --- a/config/locales/liquid_tags/fr.yml +++ b/config/locales/liquid_tags/fr.yml @@ -64,8 +64,6 @@ fr: invalid_parler_url: Invalid Parler URL podcast_tag: invalid_podcast_link: Invalid podcast link - poll_tag: - invalid_poll_id: Invalid poll ID reddit_tag: invalid_reddit_link: 'Invalid Reddit link: %{url}' replit_tag: