diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-23 15:09:20 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-23 15:09:20 +0300 |
commit | b7e512c8970dcce6feabc096885c7a1ea91e4694 (patch) | |
tree | 6efe91e491d584dba8a6d35b9bd19111adf4e519 /rubocop | |
parent | 698ab7c4bba77ffc98c14360269167092b2ebe01 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'rubocop')
-rw-r--r-- | rubocop/cop/migration/drop_table.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/rubocop/cop/migration/drop_table.rb b/rubocop/cop/migration/drop_table.rb index 2a0f57c0c13..531cbb14021 100644 --- a/rubocop/cop/migration/drop_table.rb +++ b/rubocop/cop/migration/drop_table.rb @@ -17,6 +17,7 @@ module RuboCop def on_def(node) return unless in_deployment_migration?(node) + return if down_method?(node) node.each_descendant(:send) do |send_node| next unless offensible?(send_node) @@ -27,6 +28,10 @@ module RuboCop private + def down_method?(node) + node.method?(:down) + end + def offensible?(node) drop_table?(node) || drop_table_in_execute?(node) end |