aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2015-06-09 23:33:38 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2015-06-09 23:33:38 -0300
commitd5d3d3d6585330ae10fa892b2cde6e8ac90d5156 (patch)
treea4aa860d0ddefcc070f9923e6a8ad0d91f4be31c /activesupport/lib/active_support
parent3d949f34816d6eca0a6b59cfa08d91f36e8e64dd (diff)
parentc70aee8eea066d911410f40974a3ee9d387cd834 (diff)
downloadrails-d5d3d3d6585330ae10fa892b2cde6e8ac90d5156.tar.gz
rails-d5d3d3d6585330ae10fa892b2cde6e8ac90d5156.tar.bz2
rails-d5d3d3d6585330ae10fa892b2cde6e8ac90d5156.zip
Merge pull request #20500 from repinel/use-block-not-global-var
Another use block variable instead of global
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r--activesupport/lib/active_support/inflector/methods.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/inflector/methods.rb b/activesupport/lib/active_support/inflector/methods.rb
index 49fd1723e2..be369d21c6 100644
--- a/activesupport/lib/active_support/inflector/methods.rb
+++ b/activesupport/lib/active_support/inflector/methods.rb
@@ -153,7 +153,7 @@ module ActiveSupport
# titleize('TheManWithoutAPast') # => "The Man Without A Past"
# titleize('raiders_of_the_lost_ark') # => "Raiders Of The Lost Ark"
def titleize(word)
- humanize(underscore(word)).gsub(/\b(?<!['’`])[a-z]/) { $&.capitalize }
+ humanize(underscore(word)).gsub(/\b(?<!['’`])[a-z]/) { |match| match.capitalize }
end
# Creates the name of a table like Rails does for models to table names.