Skip to content

Commit

Permalink
Suppress RuboCop's offense
Browse files Browse the repository at this point in the history
Follow rubocop/rubocop#8390.

```console
% bundle exec rake

Offenses:

lib/rubocop/cop/rails/has_many_or_has_one_dependent.rb:57:20: C:
Style/SoleNestedConditional: Consider merging nested conditions into
outer unless conditions.
            return if valid_options?(association_with_options?(node))
                   ^^

185 files inspected, 1 offense detected, 1 offense auto-correctable
RuboCop failed!
```
  • Loading branch information
koic committed Aug 23, 2020
1 parent 630ccf0 commit 786cc67
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/rubocop/cop/rails/has_many_or_has_one_dependent.rb
Expand Up @@ -52,11 +52,7 @@ class HasManyOrHasOneDependent < Cop

def on_send(node)
return if active_resource?(node.parent)

unless association_without_options?(node)
return if valid_options?(association_with_options?(node))
end

return if !association_without_options?(node) && valid_options?(association_with_options?(node))
return if valid_options_in_with_options_block?(node)

add_offense(node, location: :selector)
Expand Down

0 comments on commit 786cc67

Please sign in to comment.