diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-20 12:55:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-20 12:55:51 +0300 |
commit | e8d2c2579383897a1dd7f9debd359abe8ae8373d (patch) | |
tree | c42be41678c2586d49a75cabce89322082698334 /spec/support/helpers/require_migration.rb | |
parent | fc845b37ec3a90aaa719975f607740c22ba6a113 (diff) |
Add latest changes from gitlab-org/gitlab@14-1-stable-eev14.1.0-rc42
Diffstat (limited to 'spec/support/helpers/require_migration.rb')
-rw-r--r-- | spec/support/helpers/require_migration.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/support/helpers/require_migration.rb b/spec/support/helpers/require_migration.rb index 8de71d3073f..de3a8a81ab5 100644 --- a/spec/support/helpers/require_migration.rb +++ b/spec/support/helpers/require_migration.rb @@ -15,7 +15,7 @@ class RequireMigration end MIGRATION_FOLDERS = %w[db/migrate db/post_migrate].freeze - SPEC_FILE_PATTERN = /.+\/(?<file_name>.+)_spec\.rb/.freeze + SPEC_FILE_PATTERN = %r{.+/(?<file_name>.+)_spec\.rb}.freeze class << self def require_migration!(file_name) @@ -29,7 +29,7 @@ class RequireMigration migration_folders.flat_map do |path| 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 |