flyerhzm / rails_best_practices

a code metric tool for rails projects
http://rails-bestpractices.com
MIT License
4.16k stars 276 forks source link

Unused helper method crashing rails_best_practices #335

Open ReganRyanNZ opened 5 years ago

ReganRyanNZ commented 5 years ago

As the title says, an unused helper method was crashing the system.

I fixed it by monkey patching into /core/check.rb:347 and changing this like:

@except_methods + internal_except_methods

to

@except_methods.to_a + internal_except_methods

So if it's already an array nothing happens, otherwise it converts nil into an empty array, allowing the + method to function.

It would be good to put this into the actual code, instead of monkey patches.