From d9662164b8076f2cb8310a389540faa38c232bcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Mon, 22 Apr 2024 19:23:11 +0200 Subject: [PATCH] Remove unused code to display polls with no dates When this code was added, in commit 1a20a3ce4, we had no validation rules checking the presence of the start and end dates of a poll. Now we do, so we don't have to check this condition in the view. --- app/components/polls/poll_component.rb | 6 +----- config/locales/en/general.yml | 1 - config/locales/es/general.yml | 1 - 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/app/components/polls/poll_component.rb b/app/components/polls/poll_component.rb index ed0374b53..92a7b64b4 100644 --- a/app/components/polls/poll_component.rb +++ b/app/components/polls/poll_component.rb @@ -9,10 +9,6 @@ class Polls::PollComponent < ApplicationComponent private def dates - if poll.starts_at.blank? || poll.ends_at.blank? - I18n.t("polls.no_dates") - else - I18n.t("polls.dates", open_at: l(poll.starts_at.to_date), closed_at: l(poll.ends_at.to_date)) - end + I18n.t("polls.dates", open_at: l(poll.starts_at.to_date), closed_at: l(poll.ends_at.to_date)) end end diff --git a/config/locales/en/general.yml b/config/locales/en/general.yml index da77b6942..bb57d29d4 100644 --- a/config/locales/en/general.yml +++ b/config/locales/en/general.yml @@ -569,7 +569,6 @@ en: share: "And if you also do me the great favor of sharing my proposal with your friends, family and contacts, it would be perfect!" polls: all: "All" - no_dates: "no date assigned" dates: "From %{open_at} to %{closed_at}" final_date: "Final recounts/Results" index: diff --git a/config/locales/es/general.yml b/config/locales/es/general.yml index 1ae7aa62f..bb91f8d66 100644 --- a/config/locales/es/general.yml +++ b/config/locales/es/general.yml @@ -569,7 +569,6 @@ es: share: "Y si además, me haces el gran favor de compartir mi propuesta con tus amigos, familiares y contactos ¡sería perfecto!" polls: all: "Todas" - no_dates: "sin fecha asignada" dates: "Desde el %{open_at} hasta el %{closed_at}" final_date: "Recuento final/Resultados" index: