Sha256: 96b28fbf89c616f2e1ad9b7d871a9e3d2236286a4ddb912be4e1dbb815b5541f

Contents?: true

Size: 247 Bytes

Versions: 6

Compression:

Stored size: 247 Bytes

Contents

class SuframaValidator < ActiveModel::EachValidator
  def validate_each(record, attribute, value)
    return if value.blank?

    suframa = BrDocuments::Suframa.new(value)
    record.errors.add(attribute, :invalid) unless suframa.valid?
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
br_documents-0.2.5 lib/br_documents/suframa_validator.rb
br_documents-0.2.4 lib/br_documents/suframa_validator.rb
br_documents-0.2.3 lib/br_documents/suframa_validator.rb
br_documents-0.2.2 lib/br_documents/suframa_validator.rb
br_documents-0.2.1 lib/br_documents/suframa_validator.rb
br_documents-0.2.0 lib/br_documents/suframa_validator.rb