mirror of
https://github.com/rickbarrette/redmine_qbo_lineitems.git
synced 2026-04-02 07:01:59 -04:00
Don't save blank line items
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
<td>
|
||||
<%= f.number_field :quantity,
|
||||
step: 1,
|
||||
min: 1,
|
||||
min: 0,
|
||||
style: "width:90px;",
|
||||
no_label: true,
|
||||
disabled: readonly %>
|
||||
|
||||
@@ -20,7 +20,9 @@ module RedmineQboLineItems
|
||||
|
||||
base.class_eval do
|
||||
has_many :line_items, dependent: :destroy
|
||||
accepts_nested_attributes_for :line_items, allow_destroy: true
|
||||
accepts_nested_attributes_for :line_items,
|
||||
allow_destroy: true,
|
||||
reject_if: proc { |attrs| attrs['description'].blank? }
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user