diff options
Diffstat (limited to 'rubocop/cop/migration/drop_table.rb')
-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 |