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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user