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

Add new Rails/DuplicateIgnoredColumns cop #761

Closed

Commits on Sep 9, 2022

  1. Add new Rails/AvoidDuplicateIgnoredColumns cop

    This cop checks for duplicate calls to
    `ActiveRecord::Base.ignore_columns=` as the subsequent calls will
    override the first call.
    
    Example:
    
        # bad
        class User < ApplicationRecord
          self.ignored_columns = %w(profile)
          self.ignored_columns = %w(birthday)
        end
    
        # good
        class User < ApplicationRecord
          self.ignored_columns = %w(profile birthday)
        end
    sikachu committed Sep 9, 2022
    Configuration menu
    Copy the full SHA
    4a71187 View commit details
    Browse the repository at this point in the history
  2. Utilize ActiveRecordHelper

    sikachu committed Sep 9, 2022
    Configuration menu
    Copy the full SHA
    e2e4f57 View commit details
    Browse the repository at this point in the history
  3. Rename current_node to node

    sikachu committed Sep 9, 2022
    Configuration menu
    Copy the full SHA
    9261b75 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7d34cfb View commit details
    Browse the repository at this point in the history
  5. Utilize RESTRICT_ON_SEND

    sikachu committed Sep 9, 2022
    Configuration menu
    Copy the full SHA
    0c8cc21 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    ddc247c View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    30dd399 View commit details
    Browse the repository at this point in the history