From ac6941fb714b17a5fab5de8e9265e426feb0fad9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Fri, 21 Dec 2012 17:10:16 -0300 Subject: [PATCH] Use :present as key for the absence validatior message --- activemodel/lib/active_model/locale/en.yml | 2 +- activemodel/lib/active_model/validations/absence.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/activemodel/lib/active_model/locale/en.yml b/activemodel/lib/active_model/locale/en.yml index 8ea34b84f5f..540e8132d32 100644 --- a/activemodel/lib/active_model/locale/en.yml +++ b/activemodel/lib/active_model/locale/en.yml @@ -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)" diff --git a/activemodel/lib/active_model/validations/absence.rb b/activemodel/lib/active_model/validations/absence.rb index 2c6df60020e..1a1863370b9 100644 --- a/activemodel/lib/active_model/validations/absence.rb +++ b/activemodel/lib/active_model/validations/absence.rb @@ -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