mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-14 05:05:55 +08:00
24dd25d9f5
Lessons learned during this fix: Don't use dependant: :destroy on both ends of association between 2 ActiveRecords, or you will run into stack overflow.
15 lines
536 B
Text
15 lines
536 B
Text
<% day = 366 %>
|
|
<% current_day = DateTime.current.strftime('%j').to_i %>
|
|
|
|
<% comments.each do |comment| %>
|
|
<% comment_day = comment.created_at.strftime('%j').to_i %>
|
|
<% if comment_day < current_day and comment_day < day %>
|
|
<% day = comment.created_at.strftime('%j').to_i %>
|
|
<li class="comment-date-separator">
|
|
<p class="text-center"><%= comment.created_at.strftime('%d.%m.%Y') %></p>
|
|
</li>
|
|
<% end %>
|
|
<li class="comment">
|
|
<%= render 'result_comments/comment.html.erb', comment: comment %>
|
|
</li>
|
|
<% end %>
|