forked from fixin.me/fixin.me
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:
@@ -1,4 +1,4 @@
|
||||
<%= turbo_stream.remove @unit %>
|
||||
<%= turbo_stream.replace @previous_base unless @previous_base.nil? %>
|
||||
<%= turbo_stream.replace @unit.base unless @unit.base.nil? || @previous_base == @unit.base %>
|
||||
<%= @before.nil? ? turbo_stream.append(:units, @unit) : turbo_stream.before(@before, @unit) %>
|
||||
<%= turbo_stream.replace @previous_base if @previous_base %>
|
||||
<%= turbo_stream.replace @unit.base if @unit.base_id? && (@previous_base.id != @unit.base_id) %>
|
||||
<%= @before ? turbo_stream.before(@before, @unit) : turbo_stream.append(:units, @unit) %>
|
||||
|
||||
Reference in New Issue
Block a user