diff --git a/app/views/line_items/_line_item_fields.html.erb b/app/views/line_items/_line_item_fields.html.erb
index a596f97..8b4bf5c 100644
--- a/app/views/line_items/_line_item_fields.html.erb
+++ b/app/views/line_items/_line_item_fields.html.erb
@@ -13,7 +13,7 @@
<%= f.number_field :quantity,
step: 1,
- min: 1,
+ min: 0,
style: "width:90px;",
no_label: true,
disabled: readonly %>
diff --git a/lib/redmine_qbo_line_items/patches/issue_patch.rb b/lib/redmine_qbo_line_items/patches/issue_patch.rb
index ccc155a..ad211c7 100644
--- a/lib/redmine_qbo_line_items/patches/issue_patch.rb
+++ b/lib/redmine_qbo_line_items/patches/issue_patch.rb
@@ -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
|