diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2019-04-29 18:20:44 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-29 18:20:44 +0900 |
commit | e6c177e07cd4ea42df751b5baef8858efa97dfbd (patch) | |
tree | e316a2841ccbc16f71484b0e4063f2b0704826f9 /activesupport | |
parent | 3c823271af52a61e825123def170fe2187057577 (diff) | |
parent | fd205edd7dacc832dd6298531702dbea00aba8dd (diff) | |
download | rails-e6c177e07cd4ea42df751b5baef8858efa97dfbd.tar.gz rails-e6c177e07cd4ea42df751b5baef8858efa97dfbd.tar.bz2 rails-e6c177e07cd4ea42df751b5baef8858efa97dfbd.zip |
Merge pull request #36129 from okuramasafumi/improve-error-message-of-delegate
Improve error message of ActiveSupport delegate
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/core_ext/module/delegation.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/module/delegation.rb b/activesupport/lib/active_support/core_ext/module/delegation.rb index 5652f2d1cc..9fe7f8fe01 100644 --- a/activesupport/lib/active_support/core_ext/module/delegation.rb +++ b/activesupport/lib/active_support/core_ext/module/delegation.rb @@ -170,7 +170,7 @@ class Module # The target method must be public, otherwise it will raise +NoMethodError+. def delegate(*methods, to: nil, prefix: nil, allow_nil: nil, private: nil) unless to - raise ArgumentError, "Delegation needs a target. Supply an options hash with a :to key as the last argument (e.g. delegate :hello, to: :greeter)." + raise ArgumentError, "Delegation needs a target. Supply a keyword argument 'to' (e.g. delegate :hello, to: :greeter)." end if prefix == true && /^[^a-z_]/.match?(to) |