Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve rubocop-rails Rails/SkipsModelValidations warnings #1992

Closed
tas50 opened this issue Jul 5, 2021 · 1 comment
Closed

Resolve rubocop-rails Rails/SkipsModelValidations warnings #1992

tas50 opened this issue Jul 5, 2021 · 1 comment

Comments

@tas50
Copy link
Contributor

tas50 commented Jul 5, 2021

I'm going to disable these to get the builds green for now, but we should investigate these warnings and see what's necessary to resolve them:

 Offenses:

Error: app/controllers/api/v1/cookbook_versions_controller.rb:26:21: C: Rails/SkipsModelValidations: Avoid using increment_counter because it skips validations.
    CookbookVersion.increment_counter(:api_download_count, @cookbook_version.id)
                    ^^^^^^^^^^^^^^^^^
Error: app/controllers/api/v1/cookbook_versions_controller.rb:27:14: C: Rails/SkipsModelValidations: Avoid using increment_counter because it skips validations.
    Cookbook.increment_counter(:api_download_count, @cookbook.id)
             ^^^^^^^^^^^^^^^^^
Error: app/controllers/cookbook_versions_controller.rb:10:21: C: Rails/SkipsModelValidations: Avoid using increment_counter because it skips validations.
    CookbookVersion.increment_counter(:web_download_count, @version.id)
                    ^^^^^^^^^^^^^^^^^
Error: app/controllers/cookbook_versions_controller.rb:11:14: C: Rails/SkipsModelValidations: Avoid using increment_counter because it skips validations.
    Cookbook.increment_counter(:web_download_count, @cookbook.id)
             ^^^^^^^^^^^^^^^^^
Error: spec/controllers/api/v1/cookbooks_controller_spec.rb:25:20: C: Rails/SkipsModelValidations: Avoid using touch because it skips validations.
      slow_cooking.touch
                   ^^^^^
Error: spec/controllers/cookbooks_controller_spec.rb:48:20: C: Rails/SkipsModelValidations: Avoid using touch because it skips validations.
        cookbook_2.touch
                   ^^^^^
Error: spec/models/cookbook_spec.rb:734:13: C: Rails/SkipsModelValidations: Avoid using touch because it skips validations.
      great.touch
            ^^^^^

383 files inspected, 7 offenses detected
Error: Process completed with exit code 1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant