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.
This commit is contained in:
Javi Martín
2024-04-22 19:23:11 +02:00
parent 438fe7bd25
commit d9662164b8
3 changed files with 1 additions and 7 deletions

View File

@@ -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