aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-05-13 16:11:40 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-05-13 16:11:40 -0300
commit2b84eea9c0ccf910111c447a04ed968f2e8a74d2 (patch)
tree46c24d584eca1013e6c900a3c02c1b8bd70f33b5 /activesupport/lib
parent0626543f6d4c45250da15f41d715754c3be5a67e (diff)
parent3703a8ae9b74ef76551a1e95d4d31aa9fce72eb3 (diff)
downloadrails-2b84eea9c0ccf910111c447a04ed968f2e8a74d2.tar.gz
rails-2b84eea9c0ccf910111c447a04ed968f2e8a74d2.tar.bz2
rails-2b84eea9c0ccf910111c447a04ed968f2e8a74d2.zip
Merge pull request #15072 from mjtko/fix/issue-15064
[Fixes #15064] Calling number_to_delimited on a ActiveSupport::SafeBuffer results in mangled output
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/number_helper/number_to_delimited_converter.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/number_helper/number_to_delimited_converter.rb b/activesupport/lib/active_support/number_helper/number_to_delimited_converter.rb
index 6405afc9a6..d85cc086d7 100644
--- a/activesupport/lib/active_support/number_helper/number_to_delimited_converter.rb
+++ b/activesupport/lib/active_support/number_helper/number_to_delimited_converter.rb
@@ -13,7 +13,9 @@ module ActiveSupport
def parts
left, right = number.to_s.split('.')
- left.gsub!(DELIMITED_REGEX) { "#{$1}#{options[:delimiter]}" }
+ left.gsub!(DELIMITED_REGEX) do |digit_to_delimit|
+ "#{digit_to_delimit}#{options[:delimiter]}"
+ end
[left, right].compact
end
end