erblint: avoid negated if conditions
authorTom Hughes <tom@compton.nu>
Wed, 27 Mar 2019 18:49:01 +0000 (18:49 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 27 Mar 2019 18:49:01 +0000 (18:49 +0000)
.erb-lint.yml
app/views/messages/_message_summary.html.erb

index 9c3d6b0..390d86c 100644 (file)
@@ -37,8 +37,6 @@ linters:
         Enabled: false # TODO
       Style/SymbolProc:
         Enabled: false # TODO
-      Style/NegatedIf:
-        Enabled: false # TODO
       Style/ConditionalAssignment:
         Enabled: false # TODO
 exclude:
index e69f436..057a898 100644 (file)
@@ -1,4 +1,4 @@
-<tr id="inbox-<%= message_summary.id %>" class="inbox-row<%= "-unread" if !message_summary.message_read? %>">
+<tr id="inbox-<%= message_summary.id %>" class="inbox-row<%= "-unread" unless message_summary.message_read? %>">
   <td class="inbox-sender"><%= link_to h(message_summary.sender.display_name), user_path(message_summary.sender) %></td>
   <td class="inbox-subject"><%= link_to h(message_summary.title), message_path(message_summary) %></td>
   <td class="inbox-sent"><%= l message_summary.sent_on, :format => :friendly %></td>