Displaying 1 result from an estimated 1 matches for "price_sold".
2005 Dec 17
0
bug? saving (valid) updated object results in validation error
...ng to the documentation! I have a class, defined as below.
> class Coupon < ActiveRecord::Base
> belongs_to :product
> belongs_to :account
> validates_presence_of :product
> validates_associated :product
> validates_presence_of :voucher
> validates_presence_of :price_sold
> validates_uniqueness_of :voucher
> validates_length_of :voucher, :within => 10 .. 50
> validates_numericality_of :price_sold
> validates_numericality_of :voucher, :only_integer => true
> validates_each :price_sold do |rec, s, t|
> t ||= 0; rec.errors.add s, &...