af83/chouette-core

View on GitHub
app/validators/valid_validator.rb

Summary

Maintainability
A
0 mins
Test Coverage
class ValidValidator < ActiveModel::EachValidator
  def validate_each(record, attribute, value)
    if value && !value.valid?
      record.errors.add attribute, (options[:message] || "is not valid")
    end
  end
end