Skip to content

Commit

Permalink
Use :present as key for the absence validatior message
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelfranca committed Dec 21, 2012
1 parent b437053 commit ac6941f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion activemodel/lib/active_model/locale/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down
2 changes: 1 addition & 1 deletion activemodel/lib/active_model/validations/absence.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit ac6941f

Please sign in to comment.