erblint: use conditional assignment
authorTom Hughes <tom@compton.nu>
Wed, 27 Mar 2019 18:59:52 +0000 (18:59 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 27 Mar 2019 18:59:52 +0000 (18:59 +0000)
.erb-lint.yml
app/views/changesets/history.html.erb

index bf59177..25811bc 100644 (file)
@@ -31,7 +31,5 @@ linters:
         Enabled: false # TODO
       Rails/LinkToBlank:
         Enabled: false # TODO
-      Style/ConditionalAssignment:
-        Enabled: false # TODO
 exclude:
   - '**/vendor/**'
index f27aacb..55a137f 100644 (file)
@@ -6,11 +6,11 @@
 
 <%
    set_title(changeset_index_title(params, current_user))
-   if params[:display_name]
-     @heading = t("changesets.index.title_user", :user => link_to(params[:display_name], user_path(:display_name => params[:display_name]))).html_safe
-   else
-     @heading = @title
-   end
+   @heading = if params[:display_name]
+                t("changesets.index.title_user", :user => link_to(params[:display_name], user_path(:display_name => params[:display_name]))).html_safe
+              else
+                @title
+              end
 %>
 
 <h2>