From a7706bcb567ee31c6454c4197354b3210839b564 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 19 Sep 2019 00:06:11 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- rubocop/migration_helpers.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'rubocop') diff --git a/rubocop/migration_helpers.rb b/rubocop/migration_helpers.rb index c066d424437..577f768da67 100644 --- a/rubocop/migration_helpers.rb +++ b/rubocop/migration_helpers.rb @@ -3,15 +3,17 @@ module RuboCop module MigrationHelpers # Returns true if the given node originated from the db/migrate directory. def in_migration?(node) - dirname = File.dirname(node.location.expression.source_buffer.name) - - dirname.end_with?('db/migrate', 'db/post_migrate') + dirname(node).end_with?('db/migrate', 'db/geo/migrate') || in_post_deployment_migration?(node) end def in_post_deployment_migration?(node) - dirname = File.dirname(node.location.expression.source_buffer.name) + dirname(node).end_with?('db/post_migrate', 'db/geo/post_migrate') + end + + private - dirname.end_with?('db/post_migrate') + def dirname(node) + File.dirname(node.location.expression.source_buffer.name) end end end -- cgit v1.2.1