Commit f98c62a3 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch 'ka-improve-require-migration-regex' into 'master'

Improve regex used in "require_migration!" test helper

See merge request gitlab-org/gitlab!65701
parents 5226c013 d8173b0c
...@@ -29,7 +29,7 @@ class RequireMigration ...@@ -29,7 +29,7 @@ class RequireMigration
migration_folders.flat_map do |path| migration_folders.flat_map do |path|
migration_path = Rails.root.join(path).to_s migration_path = Rails.root.join(path).to_s
Find.find(migration_path).grep(/\d+_#{file_name}\.rb/) Find.find(migration_path).select { |m| File.basename(m).match? /\A\d+_#{file_name}\.rb\z/ }
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment