Skip to content

Commit

Permalink
Fix rubocop offense
Browse files Browse the repository at this point in the history
```ruby
lib/rubocop/cop/factory_bot/association_style.rb:251:21: C: [Corrected] InternalAffairs/RedundantMethodDispatchNode: Remove the redundant send_node.
            ancestor.send_node.method?(:factory) if ancestor.block_type?
```
  • Loading branch information
ydah committed Sep 3, 2023
1 parent 2b2b422 commit b860873
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rubocop/cop/factory_bot/association_style.rb
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def options_for_autocorrect_to_implicit_style(node)

def trait_within_trait?(node)
factory_node = node.ancestors.reverse.find do |ancestor|
ancestor.send_node.method?(:factory) if ancestor.block_type?
ancestor.method?(:factory) if ancestor.block_type?
end

trait_name(factory_node).include?(node.method_name)
Expand Down

0 comments on commit b860873

Please sign in to comment.