We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
with_options
My code has:
class Registrant < ApplicationRecord with_options dependent: :destroy do has_one :contact_detail, autosave: true, inverse_of: :registrant has_one :standard_skill_routine end end
And the rubocop HasManyOrHasOneDependent flags it:
app/models/registrant.rb:49:5: C: Rails/HasManyOrHasOneDependent: Specify a :dependent option. has_one :contact_detail, autosave: true, inverse_of: :registrant ^^^^^^^ app/models/registrant.rb:50:5: C: Rails/HasManyOrHasOneDependent: Specify a :dependent option. has_one :standard_skill_routine ^^^^^^^
This is unexpected, since I am specifying a dependent option for the has_one...just not directly (which is permitted by rails)
dependent
Not flag my code for having no dependent: option.
dependent:
Flags the code as needing a depndent: option
depndent:
See above code
0.50.0
The text was updated successfully, but these errors were encountered:
Yeah, guess we didn't factor this when the cop was developed. Should be relatively easy to fix.
Sorry, something went wrong.
Rails/HasManyOrHasOneDependent
[Fix rubocop#4747] Fix Rails/HasManyOrHasOneDependent incorrectly f…
e3bba2b
…lags `with_options` blocks
[Fix #4747] Fix Rails/HasManyOrHasOneDependent incorrectly flags `w…
1b1a7d5
…ith_options` blocks
Successfully merging a pull request may close this issue.
My code has:
And the rubocop HasManyOrHasOneDependent flags it:
This is unexpected, since I am specifying a
dependent
option for the has_one...just not directly (which is permitted by rails)http://api.rubyonrails.org/classes/Object.html#method-i-with_options
Expected behavior
Not flag my code for having no
dependent:
option.Actual behavior
Flags the code as needing a
depndent:
optionSteps to reproduce the problem
See above code
RuboCop version
0.50.0
The text was updated successfully, but these errors were encountered: