aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activesupport/lib/active_support/core_ext/module/delegation.rb3
1 files changed, 2 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 4a899a7d84..8350753f78 100644
--- a/activesupport/lib/active_support/core_ext/module/delegation.rb
+++ b/activesupport/lib/active_support/core_ext/module/delegation.rb
@@ -1,4 +1,5 @@
require 'active_support/core_ext/object/public_send'
+require 'active_support/core_ext/string/starts_ends_with'
class Module
# Provides a delegate class method to easily expose contained objects' methods
@@ -126,7 +127,7 @@ class Module
methods.each do |method|
method = method.to_s
- call = (method[-1..-1] == '=') ? "public_send(:#{method}, " : "#{method}("
+ call = method.ends_with?('=') ? "public_send(:#{method}, " : "#{method}("
if allow_nil
module_eval(<<-EOS, file, line - 2)