Class: Congo::Metadata::Validation
- Inherits:
-
Object
- Object
- Congo::Metadata::Validation
- Includes:
- MongoMapper::EmbeddedDocument
- Defined in:
- lib/congo/metadata/validation.rb
Instance Method Summary collapse
Instance Method Details
#apply(klass, scope) ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/congo/metadata/validation.rb', line 17 def apply(klass, scope) = { :message => type_to_i18n } case self.type when 'format_of' .merge! :with => /#{self.argument}/ end klass.send("validates_#{type}", key, ) end |