% if audit_record.audited_changes.find{|field, (old_value,new_value)| !old_value.blank? || !new_value.blank? } %>
<%= audit_record.auditable_type.constantize.model_name.human %>: <%= audit_object_info(audit_record) %>
<%= t("audits.field") %> | <%= t("audits.old_value") %> | <%= t("audits.new_value") %> | ||
---|---|---|---|---|
<%= audit_record_human_field(audit_record, field) %> | <% if audit_record.action == "update" && audit_record.auditable_type.constantize.column_for_attribute(field.to_sym).type == :text %><%= sanitize Differ.diff(new_value.to_s, old_value.to_s).format_as(:html) %> | <% else %><% 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 %>