Class: SexyValidations::Validators::Format
- Inherits:
-
Object
- Object
- SexyValidations::Validators::Format
- Defined in:
- lib/sexy_validations/validators/format.rb
Class Method Summary collapse
Class Method Details
.validate(model, attribute, value, options) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/sexy_validations/validators/format.rb', line 5 def self.validate(model, attribute, value, ) return if value.blank? unless .is_a?(Hash) = { :with => , } end unless value.to_s =~ [:with] model.errors.add(attribute, [:message] || "ungültiges Format") end end |