Class: MongoDoc::ActiveModel::Validations::ValidatesEmbedded
- Inherits:
-
ActiveModel::EachValidator
- Object
- ActiveModel::EachValidator
- MongoDoc::ActiveModel::Validations::ValidatesEmbedded
- Defined in:
- lib/mongo_doc/active_model/validations.rb
Instance Method Summary collapse
Instance Method Details
#validate(record) ⇒ Object
11 12 13 14 15 |
# File 'lib/mongo_doc/active_model/validations.rb', line 11 def validate(record) attributes.each do |attr| record.errors.add(attr) unless record.send(attr).valid? end end |