Skip to content

Commit 17a0cba

Browse files
feat product.rb: task #7
must be greater or equal to zero.
1 parent 0ae1b45 commit 17a0cba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/models/product.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class Product < ApplicationRecord
4242

4343
with_options presence: true do
4444
validates :name
45-
validates :price, numericality: { greater_than: 0 }
45+
validates :price, numericality: { greater_than_or_equal_to: 0 }
4646
end
4747

4848
after_save :synchronize_stock

0 commit comments

Comments
 (0)