diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-12-26 19:08:08 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-12-26 19:22:38 -0300 |
commit | 9647d4b6f4483f4fc88775020f125c61634192fd (patch) | |
tree | ba4ceac2711519b0e74d0c56573caee3ab1a2c13 /activemodel | |
parent | 14a61bba4dda8a48a1949960ee31e28973473916 (diff) | |
download | rails-9647d4b6f4483f4fc88775020f125c61634192fd.tar.gz rails-9647d4b6f4483f4fc88775020f125c61634192fd.tar.bz2 rails-9647d4b6f4483f4fc88775020f125c61634192fd.zip |
Add CHANGELOG entry for #8622
Diffstat (limited to 'activemodel')
-rw-r--r-- | activemodel/CHANGELOG.md | 5 | ||||
-rw-r--r-- | activemodel/test/cases/validations/presence_validation_test.rb | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/activemodel/CHANGELOG.md b/activemodel/CHANGELOG.md index 09e6ede064..cd17b1a73f 100644 --- a/activemodel/CHANGELOG.md +++ b/activemodel/CHANGELOG.md @@ -1,5 +1,10 @@ ## Rails 4.0.0 (unreleased) ## +* Fix `validates_presence_of` with `:allow_nil` or `:allow_blank` options. + Fixes #8621. + + *Colin Kelley and Rafael Mendonça França* + * Add `ActiveModel::Validations::AbsenceValidator`, a validator to check the absence of attributes. diff --git a/activemodel/test/cases/validations/presence_validation_test.rb b/activemodel/test/cases/validations/presence_validation_test.rb index f77d4da29f..2f228cfa83 100644 --- a/activemodel/test/cases/validations/presence_validation_test.rb +++ b/activemodel/test/cases/validations/presence_validation_test.rb @@ -71,7 +71,7 @@ class PresenceValidationTest < ActiveModel::TestCase assert p.valid? end - def test_allow_nil + def test_validates_presence_of_with_allow_nil_option Topic.validates_presence_of(:title, allow_nil: true) t = Topic.new(title: "something") @@ -89,7 +89,7 @@ class PresenceValidationTest < ActiveModel::TestCase assert t.valid?, t.errors.full_messages end - def test_allow_blank + def test_validates_presence_of_with_allow_blank_option Topic.validates_presence_of(:title, allow_blank: true) t = Topic.new(title: "something") |