File tree Expand file tree Collapse file tree 3 files changed +3
-1
lines changed
Expand file tree Collapse file tree 3 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ class Item < ApplicationRecord
4141 validates :distribution_quantity , numericality : { greater_than : 0 } , allow_blank : true
4242 validates :on_hand_recommended_quantity , numericality : { greater_than_or_equal_to : 0 } , allow_blank : true
4343 validates :on_hand_minimum_quantity , numericality : { greater_than_or_equal_to : 0 }
44+ validates :package_size , numericality : { greater_than_or_equal_to : 0 } , allow_blank : true
4445
4546 has_many :line_items , dependent : :destroy
4647 has_many :inventory_items , dependent : :destroy
Original file line number Diff line number Diff line change 4040 <% end %>
4141
4242 <%= f . input :name , label : "Package size" , wrapper : :input_group do %>
43- <%= f . input_field :package_size , class : "form-control" %>
43+ <%= f . input_field :package_size , class : "form-control" , min : 0 %>
4444 <% end %>
4545
4646 <% if Flipper . enabled? ( :enable_packs ) %>
Original file line number Diff line number Diff line change 4141 it { should validate_numericality_of ( :on_hand_minimum_quantity ) . is_greater_than_or_equal_to ( 0 ) }
4242 it { should validate_numericality_of ( :on_hand_recommended_quantity ) . is_greater_than_or_equal_to ( 0 ) }
4343 it { should validate_length_of ( :additional_info ) . is_at_most ( 500 ) }
44+ it { should validate_numericality_of ( :package_size ) . is_greater_than_or_equal_to ( 0 ) }
4445 end
4546
4647 context "Filtering >" do
You can’t perform that action at this time.
0 commit comments