Fix `without_validating_presence` documentation (#1177)
This commit is contained in:
parent
dfbcdc703f
commit
33ad91d093
2
NEWS.md
2
NEWS.md
|
@ -91,7 +91,7 @@ is now:
|
||||||
* *Original PR: [#956]*
|
* *Original PR: [#956]*
|
||||||
* *Original issues: [#870], [#861]*
|
* *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.
|
fact that `required` is assumed, above.
|
||||||
|
|
||||||
* *Original issues: [#1153], [#1154]*
|
* *Original issues: [#1153], [#1154]*
|
||||||
|
|
|
@ -272,9 +272,9 @@ module Shoulda
|
||||||
# should belong_to(:organization).required
|
# should belong_to(:organization).required
|
||||||
# end
|
# 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+
|
# matcher from checking whether the association disallows nil (Rails 5+
|
||||||
# only). This can be helpful if you have a custom hook that always sets
|
# only). This can be helpful if you have a custom hook that always sets
|
||||||
# the association to a meaningful value:
|
# the association to a meaningful value:
|
||||||
|
@ -293,12 +293,12 @@ module Shoulda
|
||||||
#
|
#
|
||||||
# # RSpec
|
# # RSpec
|
||||||
# describe Person
|
# describe Person
|
||||||
# it { should belong_to(:organization).without_presence_validation }
|
# it { should belong_to(:organization).without_validating_presence }
|
||||||
# end
|
# end
|
||||||
#
|
#
|
||||||
# # Minitest (Shoulda)
|
# # Minitest (Shoulda)
|
||||||
# class PersonTest < ActiveSupport::TestCase
|
# class PersonTest < ActiveSupport::TestCase
|
||||||
# should belong_to(:organization).without_presence_validation
|
# should belong_to(:organization).without_validating_presence
|
||||||
# end
|
# end
|
||||||
#
|
#
|
||||||
# ##### optional
|
# ##### optional
|
||||||
|
|
Loading…
Reference in New Issue