diff options
author | Rémy Coutable <remy@rymai.me> | 2017-05-22 18:31:22 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-05-29 11:28:23 +0200 |
commit | 187e6c8d7c9eea51358bb9b653a512ac98fa5746 (patch) | |
tree | 7a175f7695d11f4b625067e170532b9d7ab3587d /rubocop/migration_helpers.rb | |
parent | c9e9c2ffaac773ef85267e558fe345171d2ce979 (diff) | |
download | gitlab-ce-187e6c8d7c9eea51358bb9b653a512ac98fa5746.tar.gz |
New Migration/UpdateColumnInBatches cop
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'rubocop/migration_helpers.rb')
-rw-r--r-- | rubocop/migration_helpers.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/rubocop/migration_helpers.rb b/rubocop/migration_helpers.rb index 3160a784a04..c3473771178 100644 --- a/rubocop/migration_helpers.rb +++ b/rubocop/migration_helpers.rb @@ -3,8 +3,9 @@ module RuboCop module MigrationHelpers # Returns true if the given node originated from the db/migrate directory. def in_migration?(node) - File.dirname(node.location.expression.source_buffer.name). - end_with?('db/migrate') + dirname = File.dirname(node.location.expression.source_buffer.name) + + dirname.end_with?('db/migrate', 'db/post_migrate') end end end |