allow 1 char unit, eg L or g
This commit is contained in:
parent
1f71501dc1
commit
d70c3a9bf1
1 changed files with 1 additions and 1 deletions
|
@ -56,7 +56,7 @@ class Article < ApplicationRecord
|
||||||
# Validations
|
# Validations
|
||||||
validates_presence_of :name, :unit, :price, :tax, :deposit, :unit_quantity, :supplier_id, :article_category
|
validates_presence_of :name, :unit, :price, :tax, :deposit, :unit_quantity, :supplier_id, :article_category
|
||||||
validates_length_of :name, :in => 4..60
|
validates_length_of :name, :in => 4..60
|
||||||
validates_length_of :unit, :in => 2..15
|
validates_length_of :unit, :in => 1..15
|
||||||
validates_numericality_of :price, :greater_than_or_equal_to => 0
|
validates_numericality_of :price, :greater_than_or_equal_to => 0
|
||||||
validates_numericality_of :unit_quantity, :greater_than => 0
|
validates_numericality_of :unit_quantity, :greater_than => 0
|
||||||
validates_numericality_of :deposit, :tax
|
validates_numericality_of :deposit, :tax
|
||||||
|
|
Loading…
Reference in a new issue