Class: XmlFormatValidator

Inherits:
ActiveModel::EachValidator
  • Object
show all
Defined in:
lib/validates_xml.rb

Instance Method Summary collapse

Instance Method Details

#validate_each(record, attribute, value) ⇒ Object



32
33
34
35
36
# File 'lib/validates_xml.rb', line 32

def validate_each(record, attribute, value)
  err = ValidatesXML::validates_xml(value, options)
  record.errors[attribute] << err unless err.nil?
  record.errors[attribute].flatten!
end