rsl / stringex

Some [hopefully] useful extensions to Ruby’s String class. It is made up of three libraries: ActsAsUrl [permalink solution with better character translation], Unidecoder [Unicode to Ascii transliteration], and StringExtensions [miscellaneous helper methods for the String class].
MIT License
984 stars 158 forks source link

Support Ruby 2.7 arg syntax in callback_options #209

Closed jocmp closed 1 year ago

jocmp commented 1 year ago

Fixes an issue in Ruby 3 and above where the callback options cause a NoMethodError.

Error: test_should_truncate_words_by_default(ActsAsUrlIntegrationTest):
  NoMethodError: undefined method `before_validation' for [:on, :create]:Array

              target.send(method, *arguments, &block)
                    ^^^^^