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

[Fix #1249] Disable Rails/UnusedIgnoredColumns by default #1252

Merged
merged 1 commit into from Mar 31, 2024

Conversation

Earlopain
Copy link
Contributor

Fix #1249

This cop can't be used to effectivly check for unused columns because the development and production schema can be out of sync until the migration has been run on production.
As such, this cop can cause ignored_columns to be removed even though the production schema still contains the column, which can lead to downtime when the migration is actually executed.

Users can manually enable this cop if they know this isn't an issue that can/will impact them.

cc @rafaelfranca, let me know if the added tidbit to the cops documentation is not correct.


Before submitting the PR make sure the following are checked:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
  • Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.
  • If this is a new cop, consider making a corresponding update to the Rails Style Guide.

@Earlopain Earlopain force-pushed the disable-unused-ignored-columns branch from 4ad737c to 8c3ed86 Compare March 15, 2024 11:11
@Earlopain Earlopain force-pushed the disable-unused-ignored-columns branch from 8c3ed86 to f60be8d Compare March 20, 2024 17:43
Copy link
Contributor

@rafaelfranca rafaelfranca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for working on this. The note added to the cop makes sense to me

@koic
Copy link
Member

koic commented Mar 28, 2024

@pocke Do you have any comments on this proposal? If there are no objections, I will proceed with the merge.

@koic koic merged commit 0cd57a8 into rubocop:master Mar 31, 2024
14 checks passed
@Earlopain Earlopain deleted the disable-unused-ignored-columns branch March 31, 2024 07:03
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

Successfully merging this pull request may close these issues.

Please remove Rails/UnusedIgnoredColumns
3 participants