Class: SimplyCouch::Model::Validations::ContainmentValidator
- Inherits:
-
ActiveModel::EachValidator
- Object
- ActiveModel::EachValidator
- SimplyCouch::Model::Validations::ContainmentValidator
- Defined in:
- lib/simply_couch/model/validations.rb
Instance Method Summary collapse
Instance Method Details
#validate_each(record, attribute, value) ⇒ Object
17 18 19 20 21 |
# File 'lib/simply_couch/model/validations.rb', line 17 def validate_each(record, attribute, value) unless Array.wrap(value) - [:in] == [] record.errors.add(attribute, :inclusion, **.except(:in, :within).merge!(:value => value)) end end |