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 an error for Rails/ReversibleMigration when calling drop_table without any arguments #1409

Merged
merged 1 commit into from
Jan 8, 2025

Conversation

Earlopain
Copy link
Contributor

As it happens when you type it


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.

@@ -121,6 +121,10 @@ def change
it_behaves_like 'offense', 'drop_table(without block)', <<~RUBY
drop_table :users
RUBY

it_behaves_like 'offense', 'drop_table(without block)', <<~RUBY
Copy link
Member

Choose a reason for hiding this comment

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

It seems that it should result in no offense as it is still in a state where judgment cannot be made. Also, the description string for the spec appear to have been left as they were copied and pasted.

Suggested change
it_behaves_like 'offense', 'drop_table(without block)', <<~RUBY
it_behaves_like 'accepts', 'drop_table (without arguments)', <<~RUBY

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I switched it over to no offense, that seems fine. And yeah, failed to change the example description.

@Earlopain Earlopain force-pushed the reversible-migration-error branch from 2379661 to 46e667e Compare January 8, 2025 20:57
…` without any arguments

As it happens when you type it
@Earlopain Earlopain force-pushed the reversible-migration-error branch from 46e667e to 6a16fe3 Compare January 8, 2025 20:58
@koic koic merged commit 574e4ef into rubocop:master Jan 8, 2025
16 checks passed
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.

2 participants