flyerhzm / rails_best_practices

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

Add table_name and module_prefix to model ignored methods #306

Closed AdamWhittingham closed 6 years ago

AdamWhittingham commented 6 years ago

At present, RBP will flag the model methods table_name or module_prefix as unused, despite these mehtods being used to confgure ActiveRecord.

This PR simply adds these two methods into the exceptions list for unusued methods in models.

This list appears to be purely config and each individual member isn't tested, so I've tested this against a project and have seen the RBP errors get silenced. I'm happy to add a test for these cases if required for merging though. Similarly, let me know if I can clarify anything.