From 33ad91d0937889cddb5e41b6f24d32bc7705fca9 Mon Sep 17 00:00:00 2001 From: Berislav Babic Date: Wed, 20 Feb 2019 17:14:25 +0100 Subject: [PATCH] Fix `without_validating_presence` documentation (#1177) --- NEWS.md | 2 +- lib/shoulda/matchers/active_record/association_matcher.rb | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/NEWS.md b/NEWS.md index dad7e248..6a5f9ede 100644 --- a/NEWS.md +++ b/NEWS.md @@ -91,7 +91,7 @@ is now: * *Original PR: [#956]* * *Original issues: [#870], [#861]* -* Add `without_presence_validation` qualifier to `belong_to` to get around the +* Add `without_validating_presence` qualifier to `belong_to` to get around the fact that `required` is assumed, above. * *Original issues: [#1153], [#1154]* diff --git a/lib/shoulda/matchers/active_record/association_matcher.rb b/lib/shoulda/matchers/active_record/association_matcher.rb index df795831..39f14bc2 100644 --- a/lib/shoulda/matchers/active_record/association_matcher.rb +++ b/lib/shoulda/matchers/active_record/association_matcher.rb @@ -272,9 +272,9 @@ module Shoulda # should belong_to(:organization).required # end # - # #### without_presence_validation + # #### without_validating_presence # - # Use `without_presence_validation` with `belong_to` to prevent the + # Use `without_validating_presence` with `belong_to` to prevent the # matcher from checking whether the association disallows nil (Rails 5+ # only). This can be helpful if you have a custom hook that always sets # the association to a meaningful value: @@ -293,12 +293,12 @@ module Shoulda # # # RSpec # describe Person - # it { should belong_to(:organization).without_presence_validation } + # it { should belong_to(:organization).without_validating_presence } # end # # # Minitest (Shoulda) # class PersonTest < ActiveSupport::TestCase - # should belong_to(:organization).without_presence_validation + # should belong_to(:organization).without_validating_presence # end # # ##### optional