fixin.me/app/views/quantities/reparent.turbo_stream.erb
cryptogopher 7962cdf169 Simplify object and association checks
* check for <object> instead of <object>.nil?
* check for <association>_id? instead of <association>.nil? (avoids
  record loading)
2025-01-16 20:42:18 +01:00

10 lines
327 B
Plaintext

<% @self_and_progenies.each do |q| %>
<%= turbo_stream.remove q %>
<% end %>
<% @previous_ancestors.union(@ancestors).map do |ancestor| %>
<%= turbo_stream.replace ancestor %>
<% end %>
<% @self_and_progenies.each do |q| %>
<%= @before ? turbo_stream.before(@before, q) : turbo_stream.append(:quantities, q) %>
<% end %>