]> gitweb.mndrdr.org Git - arelpe.git/commitdiff
Better handling of empty values (not that they should pass validation in the first...
authorAidan Cornelius-Bell <[email protected]>
Mon, 16 Dec 2024 06:02:40 +0000 (16:32 +1030)
committerAidan Cornelius-Bell <[email protected]>
Mon, 16 Dec 2024 06:02:40 +0000 (16:32 +1030)
app/views/pubview/index.html.erb

index 3abf7e4e51d178fc1434b84cb67346801aadb152..ca19840df42bd71eac47f1f7027602855147a119 100644 (file)
@@ -14,9 +14,9 @@
 
 <div class="post">
   <ul class="container">
-    <% @items.group_by { |item| item.respond_to?(:published_at) ? item.published_at.to_date : item.created_at.to_date }.each do |date, items| %>
+    <% @items.group_by { |item| item.respond_to?(:published_at) ? item.published_at&.to_date : item.created_at.to_date }.each do |date, items| %>
       <li class="date-heading">
-        From <%= date.strftime('%B %e, %Y') %>:
+        From <%= date&.strftime('%B %e, %Y') %>:
       </li>
       <% items.each do |item| %>
         <li class="<%= item.post_type %>-item<%= if item.short_dispatch? then " thought-item" end %>">