flyerhzm / rails_best_practices

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

False positive should_generate_new_friendly_id? #265

Open lorenzosinisi opened 8 years ago

lorenzosinisi commented 8 years ago

I'm using the gem FriendlyId so one of my model does:

 extend FriendlyId

So in the model I have:

def should_generate_new_friendly_id?

And so the method is used by the model but marked as unused "Unused Methods In Models" by the gem. Would be nice to include extended Classes in the search in order to avoid those false positive.

AlexanderNosenko commented 5 years ago

In case anybody needs a quick-fix:

Writing RemoveUnusedMethodsInModelsCheck: { except_methods: ["*#should_generate_new_friendly_id?"] }

in your rails_best_practices.yml file should fix the issues.