summaryrefslogtreecommitdiff
path: root/rubocop
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-09-19 00:06:11 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-09-19 00:06:11 +0000
commita7706bcb567ee31c6454c4197354b3210839b564 (patch)
treea1cbc7e3bf93f87ea43cba4300d044510369e544 /rubocop
parente4c711546c693fff89b0b1c92f1b0dde927e0c84 (diff)
downloadgitlab-ce-a7706bcb567ee31c6454c4197354b3210839b564.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'rubocop')
-rw-r--r--rubocop/migration_helpers.rb12
1 files changed, 7 insertions, 5 deletions
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