diff options
author | Yves Senn <yves.senn@gmail.com> | 2013-06-26 13:20:26 -0700 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2013-06-26 13:20:26 -0700 |
commit | 3f50dd21c13359735bb40c5693010c6dd5e4b132 (patch) | |
tree | fede5b2683329ed7301ad6eb26efd91be61c101f /activesupport/lib/active_support/core_ext | |
parent | 577fad19089a370b3ab8fabb6fb744d2d7c0ff1c (diff) | |
parent | 8139d727c548863ea8f986d6e6a2249fe5bd83f2 (diff) | |
download | rails-3f50dd21c13359735bb40c5693010c6dd5e4b132.tar.gz rails-3f50dd21c13359735bb40c5693010c6dd5e4b132.tar.bz2 rails-3f50dd21c13359735bb40c5693010c6dd5e4b132.zip |
Merge pull request #10828 from southpolesteve/delegation_error_class
Create DelegationError class
Diffstat (limited to 'activesupport/lib/active_support/core_ext')
-rw-r--r-- | activesupport/lib/active_support/core_ext/module/delegation.rb | 4 |
1 files changed, 3 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 3dde87ac2e..9d4b78e242 100644 --- a/activesupport/lib/active_support/core_ext/module/delegation.rb +++ b/activesupport/lib/active_support/core_ext/module/delegation.rb @@ -176,7 +176,7 @@ class Module end # end EOS else - exception = %(raise "#{self}##{method_prefix}#{method} delegated to #{to}.#{method}, but #{to} is nil: \#{self.inspect}") + exception = %(raise DelegationError, "#{self}##{method_prefix}#{method} delegated to #{to}.#{method}, but #{to} is nil: \#{self.inspect}") module_eval(<<-EOS, file, line - 2) def #{method_prefix}#{method}(#{definition}) # def customer_name(*args, &block) @@ -194,3 +194,5 @@ class Module end end end + +class DelegationError < StandardError ; end |