Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-09-20 15:11:29 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-09-20 15:11:29 +0300
commit7b384a1f3d2608898318e67d11eea2914889ae81 (patch)
treeaf33e77d13b18a96156c69616cb09a3a4f7697c6 /rubocop
parentd46287cc16ba244720c6d5c00491944336972988 (diff)
Add latest changes from gitlab-org/gitlab@12-3-stable
Diffstat (limited to 'rubocop')
-rw-r--r--rubocop/migration_helpers.rb12
1 files changed, 5 insertions, 7 deletions
diff --git a/rubocop/migration_helpers.rb b/rubocop/migration_helpers.rb
index 577f768da67..c066d424437 100644
--- a/rubocop/migration_helpers.rb
+++ b/rubocop/migration_helpers.rb
@@ -3,17 +3,15 @@ module RuboCop
module MigrationHelpers
# Returns true if the given node originated from the db/migrate directory.
def in_migration?(node)
- dirname(node).end_with?('db/migrate', 'db/geo/migrate') || in_post_deployment_migration?(node)
- end
+ dirname = File.dirname(node.location.expression.source_buffer.name)
- def in_post_deployment_migration?(node)
- dirname(node).end_with?('db/post_migrate', 'db/geo/post_migrate')
+ dirname.end_with?('db/migrate', 'db/post_migrate')
end
- private
+ def in_post_deployment_migration?(node)
+ dirname = File.dirname(node.location.expression.source_buffer.name)
- def dirname(node)
- File.dirname(node.location.expression.source_buffer.name)
+ dirname.end_with?('db/post_migrate')
end
end
end