diff options
| -rw-r--r-- | activesupport/lib/active_support/core_ext/string/filters.rb | 6 | 
1 files changed, 3 insertions, 3 deletions
| diff --git a/activesupport/lib/active_support/core_ext/string/filters.rb b/activesupport/lib/active_support/core_ext/string/filters.rb index 91d91e10e1..a4cacaf789 100644 --- a/activesupport/lib/active_support/core_ext/string/filters.rb +++ b/activesupport/lib/active_support/core_ext/string/filters.rb @@ -41,8 +41,8 @@ class String    def truncate(truncate_at, options = {})      return dup unless length > truncate_at -    options[:omission] ||= '...' -    length_with_room_for_omission = truncate_at - options[:omission].length +    omission = options[:omission] || '...' +    length_with_room_for_omission = truncate_at - omission.length      stop = \        if options[:separator]          rindex(options[:separator], length_with_room_for_omission) || length_with_room_for_omission @@ -50,6 +50,6 @@ class String          length_with_room_for_omission        end -    "#{self[0, stop]}#{options[:omission]}" +    "#{self[0, stop]}#{omission}"    end  end | 
