1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Prefer normal method call over method_missing

This commit is contained in:
Akira Matsuda 2019-09-03 10:24:49 +09:00
parent ef4bf83a1b
commit aa756a4c44

View file

@ -122,7 +122,7 @@ module ActiveSupport #:nodoc:
#
# 'こんにちは'.mb_chars.limit(7).to_s # => "こん"
def limit(limit)
truncate_bytes(limit, omission: nil)
chars(@wrapped_string.truncate_bytes(limit, omission: nil))
end
# Capitalizes the first letter of every word, when possible.