You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are no offenses when validating a model file with has several has_many/has_one in with_options block.
Actual behavior
If there are two or more has_many/has_one in with_options block, offenses are generated for each association.
Steps to reproduce the problem
Modify a test in spec/rubocop/cop/rails/has_many_or_has_one_dependent_spec.rb as follows.
it "doesn't register an offense for `with_options dependent: :destroy`" do
expect_no_offenses(<<-RUBY.strip_indent)
class Person
with_options dependent: :destroy do
has_many :foo
has_many :bar
end
end
RUBY
end
Expected behavior
There are no offenses when validating a model file with has several
has_many
/has_one
inwith_options
block.Actual behavior
If there are two or more
has_many
/has_one
inwith_options
block, offenses are generated for each association.Steps to reproduce the problem
Modify a test in
spec/rubocop/cop/rails/has_many_or_has_one_dependent_spec.rb
as follows.RuboCop version
The text was updated successfully, but these errors were encountered: