Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
a29f7e91
Commit
a29f7e91
authored
Nov 12, 2020
by
Mehmet Emin INAC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extend require_migration helper on EE
parent
bca6c874
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
+19
-3
ee/spec/support/helpers/ee/require_migration.rb
ee/spec/support/helpers/ee/require_migration.rb
+15
-0
spec/support/helpers/require_migration.rb
spec/support/helpers/require_migration.rb
+4
-3
No files found.
ee/spec/support/helpers/ee/require_migration.rb
0 → 100644
View file @
a29f7e91
# frozen_string_literal: true
module
EE
module
RequireMigration
extend
ActiveSupport
::
Concern
MIGRATION_FOLDERS
=
%w[ee/db/geo/migrate ee/db/geo/post_migrate]
.
freeze
class_methods
do
def
migration_folders
@migration_folders
||=
super
+
MIGRATION_FOLDERS
end
end
end
end
spec/support/helpers/require_migration.rb
View file @
a29f7e91
...
...
@@ -14,8 +14,7 @@ class RequireMigration
end
end
FOSS_MIGRATION_FOLDERS
=
%w[db/migrate db/post_migrate]
.
freeze
ALL_MIGRATION_FOLDERS
=
(
FOSS_MIGRATION_FOLDERS
+
%w[ee/db/geo/migrate ee/db/geo/post_migrate]
).
freeze
MIGRATION_FOLDERS
=
%w[db/migrate db/post_migrate]
.
freeze
SPEC_FILE_PATTERN
=
/.+\/(?<file_name>.+)_spec\.rb/
.
freeze
class
<<
self
...
...
@@ -37,11 +36,13 @@ class RequireMigration
private
def
migration_folders
Gitlab
.
ee?
?
ALL_MIGRATION_FOLDERS
:
FOSS_
MIGRATION_FOLDERS
MIGRATION_FOLDERS
end
end
end
RequireMigration
.
prepend_if_ee
(
'EE::RequireMigration'
)
def
require_migration!
(
file_name
=
nil
)
location_info
=
caller_locations
.
first
.
path
.
match
(
RequireMigration
::
SPEC_FILE_PATTERN
)
file_name
||=
location_info
[
:file_name
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment