diff --git a/app/logical/table_builder.rb b/app/logical/table_builder.rb index ccda7e0b3..c5a2398bb 100644 --- a/app/logical/table_builder.rb +++ b/app/logical/table_builder.rb @@ -36,18 +36,11 @@ class TableBuilder end def all_row_attributes(item, i) - if !item.id.nil? - standard_attributes = { id: "#{item.model_name.singular.dasherize}-#{item.id}", "data-id": item.id } - else - standard_attributes = {} - end + return {} if !item.is_a?(ApplicationRecord) - if item.html_data_attributes.length > 0 - class_attributes = ApplicationController.helpers.data_attributes_for(item, "data", item.html_data_attributes) - else - class_attributes = {} - end - - standard_attributes.merge(class_attributes) + { + id: "#{item.model_name.singular.dasherize}-#{item.id}", + **ApplicationController.helpers.data_attributes_for(item, "data", item.html_data_attributes) + } end end diff --git a/app/views/post_events/index.html.erb b/app/views/post_events/index.html.erb index ef8a24f22..57effc0af 100644 --- a/app/views/post_events/index.html.erb +++ b/app/views/post_events/index.html.erb @@ -2,36 +2,22 @@
| Type | -User | -Description | -Resolved? | -
|---|---|---|---|
| <%= event.type_name %> | -
- <% if event.is_creator_visible? %>
- <%= link_to_user event.creator %>
- <% else %>
- hidden
- <% end %>
- <%= time_ago_in_words_tagged event.created_at %> - |
-
-
- <%= format_text event.reason %>
-
- |
- <%= event.is_resolved %> | -