From 9647d4b6f4483f4fc88775020f125c61634192fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Wed, 26 Dec 2012 19:08:08 -0300 Subject: [PATCH] Add CHANGELOG entry for #8622 --- activemodel/CHANGELOG.md | 5 +++++ .../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")