diff options
author | Roberto Vasquez Angel <robotex@robotex.de> | 2012-07-25 17:07:05 +0200 |
---|---|---|
committer | Steve Klabnik <steve@steveklabnik.com> | 2012-12-15 16:27:44 -0500 |
commit | d72a07f1d1478db9daed847eadb35bfd840674f6 (patch) | |
tree | a48970e3b40c23c23e52249f2a7a61f85fcf94d1 /activemodel/CHANGELOG.md | |
parent | c298ee403d60db6b082539c8dd4f95754034274d (diff) | |
download | rails-d72a07f1d1478db9daed847eadb35bfd840674f6.tar.gz rails-d72a07f1d1478db9daed847eadb35bfd840674f6.tar.bz2 rails-d72a07f1d1478db9daed847eadb35bfd840674f6.zip |
Add `ActiveModel::Validations::AbsenceValidator`, a validator to check the absence of attributes.
Add `ActiveModel::Errors#add_on_present` method. Adds error messages to present attributes.
Diffstat (limited to 'activemodel/CHANGELOG.md')
-rw-r--r-- | activemodel/CHANGELOG.md | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/activemodel/CHANGELOG.md b/activemodel/CHANGELOG.md index ac71b9d1dc..014500fa28 100644 --- a/activemodel/CHANGELOG.md +++ b/activemodel/CHANGELOG.md @@ -1,4 +1,23 @@ ## Rails 4.0.0 (unreleased) ## +* Add `ActiveModel::Validations::AbsenceValidator`, a validator to check the + absence of attributes. + + class Person < ActiveRecord::Base + validates_absence_of :first_name + end + + person = Person.new + person.first_name = "John" + person.valid? + => false + # first_name must be blank + + * Roberto Vasquez Angel* + +* Added `ActiveModel::Errors#add_on_present` method. Adds error messages to + present attributes. + + *Roberto Vasquez Angel* * `[attribute]_changed?` now returns `false` after a call to `reset_[attribute]!` |