Permalink
Browse files

Use :present as key for the absence validatior message

  • Loading branch information...
1 parent b437053 commit ac6941fb714b17a5fab5de8e9265e426feb0fad9 @rafaelfranca rafaelfranca committed Dec 21, 2012
View
2 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)"
View
2 activemodel/lib/active_model/validations/absence.rb
@@ -3,7 +3,7 @@ module Validations
# == 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

0 comments on commit ac6941f

Please sign in to comment.