summaryrefslogtreecommitdiff
path: root/db/fixtures
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2018-04-06 14:18:58 +0200
committerBob Van Landuyt <bob@vanlanduyt.co>2018-04-11 10:51:15 +0200
commit8ad9c4e873f2185e8bbfa6f363db32dbbba27141 (patch)
treecefefd09ed7f5b03307f31d240f7a20d757ac185 /db/fixtures
parentec43e3644436e0ae90f6fb6a64256c38ceb68cc9 (diff)
downloadgitlab-ce-8ad9c4e873f2185e8bbfa6f363db32dbbba27141.tar.gz
Rename `create_merge_request` permissions
So we can distinguish between the permissions on the source and the target project. - `create_merge_request_from` indicates a user can create a merge request with the project as a source_project - `create_merge_request_in` indicates a user can create a merge request with the project as a target_project
Diffstat (limited to 'db/fixtures')
-rw-r--r--db/fixtures/development/10_merge_requests.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/db/fixtures/development/10_merge_requests.rb b/db/fixtures/development/10_merge_requests.rb
index 30244ee4431..bcfdd058a1c 100644
--- a/db/fixtures/development/10_merge_requests.rb
+++ b/db/fixtures/development/10_merge_requests.rb
@@ -4,7 +4,7 @@ Gitlab::Seeder.quiet do
# Limit the number of merge requests per project to avoid long seeds
MAX_NUM_MERGE_REQUESTS = 10
- Project.all.reject(&:empty_repo?).each do |project|
+ Project.non_archived.with_merge_requests_enabled.reject(&:empty_repo?).each do |project|
branches = project.repository.branch_names.sample(MAX_NUM_MERGE_REQUESTS * 2)
branches.each do |branch_name|
@@ -21,7 +21,11 @@ Gitlab::Seeder.quiet do
assignee: project.team.users.sample
}
- MergeRequests::CreateService.new(project, project.team.users.sample, params).execute
+ # Only create MRs with users that are allowed to create MRs
+ developer = project.team.developers.sample
+ break unless developer
+
+ MergeRequests::CreateService.new(project, developer, params).execute
print '.'
end
end