<% if audit_record.audited_changes.find{|field, (old_value,new_value)| !old_value.blank? || !new_value.blank? } %>
<%= t(audit_record.action, scope: "audits") %> - <%= ltime audit_record.created_at %> - <%= audit_record.user %>

<%= audit_record.auditable_type.constantize.model_name.human %>: <%= audit_object_info(audit_record) %>

<% audit_record.audited_changes.each do |field, (old_value, new_value)| %> <%# if !old_value.blank? || !new_value.blank? %> <% if audit_record.action == "update" && audit_record.auditable_type.constantize.column_for_attribute(field.to_sym).type == :text %> <% else %> <% end %> <%# end %> <% end %>
<%= t("audits.field") %> <%= t("audits.old_value") %> <%= t("audits.new_value") %>
<%= audit_record_human_field(audit_record, field) %> <%= sanitize Differ.diff(new_value.to_s, old_value.to_s).format_as(:html) %> <% if audit_record.action == "create" %> - <% else %> <%= format_audited_value old_value %> <% end %> <% if audit_record.action == "create" %> <%= format_audited_value old_value %> <% elsif audit_record.action == "destroy" %> - <% else %> <%= format_audited_value new_value %> <% end %>
<% end %>