Skip to content

Commit

Permalink
Update the docs for Rails/HasManyOrHasOneDependent
Browse files Browse the repository at this point in the history
Follow #467
  • Loading branch information
koic committed Apr 28, 2021
1 parent fa01c40 commit 436009e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/modules/ROOT/pages/cops_rails.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1570,7 +1570,8 @@ This cop checks for the use of the has_and_belongs_to_many macro.

This cop looks for `has_many` or `has_one` associations that don't
specify a `:dependent` option.
It doesn't register an offense if `:through` option was specified.
It doesn't register an offense if `:through` or `dependent: nil`
was specified.

=== Examples

Expand Down
3 changes: 2 additions & 1 deletion lib/rubocop/cop/rails/has_many_or_has_one_dependent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ module Cop
module Rails
# This cop looks for `has_many` or `has_one` associations that don't
# specify a `:dependent` option.
# It doesn't register an offense if `:through` option was specified.
# It doesn't register an offense if `:through` or `dependent: nil`
# was specified.
#
# @example
# # bad
Expand Down

0 comments on commit 436009e

Please sign in to comment.