aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorJay Hayes <ur@iamvery.com>2017-12-15 14:32:52 -0600
committerJay Hayes <ur@iamvery.com>2017-12-15 14:32:52 -0600
commitc46c303c86bd50cc7d448da4b0e360e35fb0313b (patch)
tree157e25d1209af8584a45ce886abe46eee6c4d373 /activesupport
parent6bd28902e2a11060562180241335a621d7e4b864 (diff)
downloadrails-c46c303c86bd50cc7d448da4b0e360e35fb0313b.tar.gz
rails-c46c303c86bd50cc7d448da4b0e360e35fb0313b.tar.bz2
rails-c46c303c86bd50cc7d448da4b0e360e35fb0313b.zip
Clarify docs for delegate :allow_nil option
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/core_ext/module/delegation.rb7
1 files changed, 2 insertions, 5 deletions
diff --git a/activesupport/lib/active_support/core_ext/module/delegation.rb b/activesupport/lib/active_support/core_ext/module/delegation.rb
index a77f903db5..4310df3024 100644
--- a/activesupport/lib/active_support/core_ext/module/delegation.rb
+++ b/activesupport/lib/active_support/core_ext/module/delegation.rb
@@ -115,11 +115,8 @@ class Module
# invoice.customer_address # => 'Vimmersvej 13'
#
# If the target is +nil+ and does not respond to the delegated method a
- # +Module::DelegationError+ is raised, as with any other value. Sometimes,
- # however, it makes sense to be robust to that situation and that is the
- # purpose of the <tt>:allow_nil</tt> option: If the target is not +nil+, or it
- # is and responds to the method, everything works as usual. But if it is +nil+
- # and does not respond to the delegated method, +nil+ is returned.
+ # +Module::DelegationError+ is raised. If you wish to instead return +nil+,
+ # use the <tt>:allow_nil</tt> option.
#
# class User < ActiveRecord::Base
# has_one :profile