mislav/will_paginate

frozen String error on line 108 of link_renderer.rb

jdashton opened this issue · 1 comments

When running tests on my project with RUBYOPT=--enable=frozen_string_literal -W:deprecated, I see this error:

     ActionView::Template::Error:
       can't modify frozen String: ""

This traces back to line 108 in link_renderer.rb, which is attempting to << into an empty string created on line 106.

If you alter line 106 to either of the following options, this problem should go away:

        string_attributes = attributes.inject(''.dup) do |attrs, pair|

or

        string_attributes = attributes.inject(+'') do |attrs, pair|

The latter option may be incompatible with early versions of Ruby.

Thank you for reporting!

Fixed in #651