flyerhzm / rails_best_practices

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

feat: disable warnings by inline comment #384

Closed osdakira closed 3 years ago

osdakira commented 3 years ago

I would suggest stopping the warnings with inline comments. It was also voted on in the Issue #271.

+ def index # rails_best_practices:disable MoveModelLogicIntoModelCheck
- def index
  @users = User.all
  @users = @users.enabled if params[:enabled].
  @users = @users.junior if params[:junior].
  ...
end

I get the MoveModelLogicIntoModelCheck warning in Controller. However, I believe there is some code that does not need to be moved to Model. I would like to stop the warning for this method only. I want to use rails_best_practices:disable or rails_bp:disable to stop the warnings.