aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorSteve Faulkner <southpolesteve@gmail.com>2013-06-26 12:02:00 -0500
committerSteve Faulkner <southpolesteve@gmail.com>2013-06-26 15:12:54 -0500
commit8139d727c548863ea8f986d6e6a2249fe5bd83f2 (patch)
treef276df82a39c8b0ba8c2ba318c7e26b55034c0d2 /activesupport/lib/active_support
parent438e2ad3613f7266cfec77247ecb9b4e7c629b94 (diff)
downloadrails-8139d727c548863ea8f986d6e6a2249fe5bd83f2.tar.gz
rails-8139d727c548863ea8f986d6e6a2249fe5bd83f2.tar.bz2
rails-8139d727c548863ea8f986d6e6a2249fe5bd83f2.zip
Add DelegationError class. Rasied by delegation to a nil object
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/core_ext/module/delegation.rb4
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 6d42667e97..eabc1bf84a 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 \ No newline at end of file