mirror of https://github.com/rails/rails
Use :present as key for the absence validatior message
This commit is contained in:
parent
b437053b5b
commit
ac6941fb71
|
@ -13,7 +13,7 @@ en:
|
|||
accepted: "must be accepted"
|
||||
empty: "can't be empty"
|
||||
blank: "can't be blank"
|
||||
not_blank: "must be blank"
|
||||
present: "must be blank"
|
||||
too_long: "is too long (maximum is %{count} characters)"
|
||||
too_short: "is too short (minimum is %{count} characters)"
|
||||
wrong_length: "is the wrong length (should be %{count} characters)"
|
||||
|
|
|
@ -3,7 +3,7 @@ module ActiveModel
|
|||
# == Active Model Absence Validator
|
||||
class AbsenceValidator < EachValidator #:nodoc:
|
||||
def validate_each(record, attr_name, value)
|
||||
record.errors.add(attr_name, :not_blank, options) if value.present?
|
||||
record.errors.add(attr_name, :present, options) if value.present?
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue