Allow to have equal article and stockarticle.
* Modified validation to allow the same name.
This commit is contained in:
parent
c3ca3e23f9
commit
42d85c63be
1 changed files with 1 additions and 1 deletions
|
@ -42,7 +42,7 @@ class Article < ActiveRecord::Base
|
|||
validates_length_of :unit, :in => 2..15
|
||||
validates_numericality_of :price, :unit_quantity, :greater_than => 0
|
||||
validates_numericality_of :deposit, :tax
|
||||
validates_uniqueness_of :name, :scope => [:supplier_id, :deleted_at]
|
||||
validates_uniqueness_of :name, :scope => [:supplier_id, :deleted_at, :type]
|
||||
|
||||
# Callbacks
|
||||
before_save :update_price_history
|
||||
|
|
Loading…
Reference in a new issue