-
-
Notifications
You must be signed in to change notification settings - Fork 263
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
Error occurred with Rails/NotNullColumn cop #997
Labels
bug
Something isn't working
Comments
I have created a test scenario, that will trigger this error fidalgo#1 |
fidalgo
added a commit
to fidalgo/rubocop-rails
that referenced
this issue
May 4, 2023
At the NotNullColumn if a method is passed as arguments for `add_column` an error is trigger. In this commit we check if the argument is a method and return it's name as a String. Fixes rubocop#997
fidalgo
added a commit
to fidalgo/rubocop-rails
that referenced
this issue
May 4, 2023
At the NotNullColumn cop if a method is passed as arguments for `add_column` an error is triggerred: ``` NoMethodError: undefined method `value' for s(:send, nil, :string):RuboCop::AST::SendNode ``` In this commit we check if the argument is a method and when positive we return it's name as a String.
fidalgo
added a commit
to fidalgo/rubocop-rails
that referenced
this issue
May 4, 2023
At the NotNullColumn cop if a method or variable is passed as arguments for `add_column` an error is triggerred: ``` NoMethodError: undefined method `value' for s(:send, nil, :string):RuboCop::AST::SendNode ``` In this commit we an extra check to ensure the type has the `value` method implemented, before invoking it.
koic
added a commit
that referenced
this issue
May 4, 2023
[Fix #997] Allow NotNullColumn to work with method calls
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After updating rubocop and friends I start having this error:
An error occurred while Rails/NotNullColumn cop was inspecting db/migrate/20220208103203_add_widget_type_to_widgets.registrations_component.rb:27:8.
Expected behavior
Report errors or corrections
Actual behavior
error occurred while Rails/NotNullColumn cop was inspecting db/migrate/20220208103203_add_widget_type_to_widgets.registrations_component.rb:27:8. of this migration:
and the backtrace:
Steps to reproduce the problem
If you copy that code to a migration and run rubocop on that file the error will pop up.
RuboCop version
Also, on another project, with the same migration:
The text was updated successfully, but these errors were encountered: