Added zero_nil to Quantity form and import
This commit is contained in:
@@ -29,6 +29,8 @@ class BodyTrackersController < ApplicationController
|
||||
attrs = q.attributes.except('id', 'project_id', 'parent_id', 'lft', 'rgt',
|
||||
'created_at', 'updated_at')
|
||||
attrs['parent'] = q.parent ? available[[q.parent.name, q.parent.domain]] : nil
|
||||
attrs['formula_attributes'] = q.formula.attributes.except('id', 'quantity_id',
|
||||
'created_at', 'updated_at')
|
||||
obj = @project.quantities.create(attrs)
|
||||
available[[q.name, q.domain]] = obj
|
||||
end
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
<p><%= f.text_field :description, style: "width: 100%;" %></p>
|
||||
<%= f.fields_for :formula do |ff| %>
|
||||
<p><%= ff.text_field :code, placeholder: t('.formula_placeholder'),
|
||||
style: "width: 100%;" %></p>
|
||||
style: "width: 100%;" %></p>
|
||||
<p><%= ff.check_box :zero_nil, {label: ''} %><%= t('.zero_nil') %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user