Class: Effective::SoldOutValidator

Inherits:
ActiveModel::Validator
  • Object
show all
Defined in:
app/models/effective/sold_out_validator.rb

Instance Method Summary collapse

Instance Method Details

#validate(record) ⇒ Object



3
4
5
# File 'app/models/effective/sold_out_validator.rb', line 3

def validate(record)
  record.errors[:base] << 'sold out' if record.sold_out?
end