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:
@@ -2,16 +2,14 @@
|
||||
<%- tag.tr id: row, class: "form", onkeydown: "processKey(event)",
|
||||
data: {link: link, form: form_tag, hidden_row: hidden_row} do %>
|
||||
|
||||
<td class="<%= class_names({subunit: @unit.base}) %>">
|
||||
<td class="<%= class_names({subunit: @unit.base_id?}) %>">
|
||||
<%= form.text_field :symbol, required: true, autofocus: true, size: 12 %>
|
||||
</td>
|
||||
<td>
|
||||
<%= form.text_area :description, cols: 30, rows: 1, escape: false %>
|
||||
</td>
|
||||
<td class="number">
|
||||
<% unless @unit.base.nil? %>
|
||||
<%= form.number_field :multiplier, required: true, size: 10, min: :step %>
|
||||
<% end %>
|
||||
<%= form.number_field :multiplier, required: true, size: 10, min: :step if @unit.base_id? %>
|
||||
</td>
|
||||
|
||||
<td class="actions">
|
||||
|
||||
Reference in New Issue
Block a user