aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model/validations/absence.rb
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2012-12-21 17:10:16 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2012-12-21 17:10:16 -0300
commitac6941fb714b17a5fab5de8e9265e426feb0fad9 (patch)
tree9721a6a28217831d0e254f05e213dc6935be9ad6 /activemodel/lib/active_model/validations/absence.rb
parentb437053b5b5c04712b9bf851353d08cff0600430 (diff)
downloadrails-ac6941fb714b17a5fab5de8e9265e426feb0fad9.tar.gz
rails-ac6941fb714b17a5fab5de8e9265e426feb0fad9.tar.bz2
rails-ac6941fb714b17a5fab5de8e9265e426feb0fad9.zip
Use :present as key for the absence validatior message
Diffstat (limited to 'activemodel/lib/active_model/validations/absence.rb')
-rw-r--r--activemodel/lib/active_model/validations/absence.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/validations/absence.rb b/activemodel/lib/active_model/validations/absence.rb
index 2c6df60020..1a1863370b 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