Simplify object and association checks

* check for <object> instead of <object>.nil?
* check for <association>_id? instead of <association>.nil? (avoids
  record loading)
This commit is contained in:
2025-01-16 20:42:18 +01:00
parent c908063212
commit 7962cdf169
13 changed files with 24 additions and 26 deletions

View File

@@ -5,5 +5,5 @@
<%= turbo_stream.replace ancestor %>
<% end %>
<% @self_and_progenies.each do |q| %>
<%= @before.nil? ? turbo_stream.append(:quantities, q) : turbo_stream.before(@before, q) %>
<%= @before ? turbo_stream.before(@before, q) : turbo_stream.append(:quantities, q) %>
<% end %>