summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZ.J. van de Weg <zegerjan@gitlab.com>2016-06-10 13:31:42 +0200
committerZ.J. van de Weg <zegerjan@gitlab.com>2016-06-15 11:55:41 +0200
commit7dc08033b9cbd2876ed444878525d9f8bbfcef64 (patch)
treed5e1461eac0703c5ec6254e52b0d92419f283b6c
parentbd3324cca2fefb00e421c4dc1fb276db540d08bd (diff)
downloadgitlab-ce-7dc08033b9cbd2876ed444878525d9f8bbfcef64.tar.gz
Near half of the Issues get Award Emoji when seeding
-rw-r--r--db/fixtures/development/15_award_emoji.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/db/fixtures/development/15_award_emoji.rb b/db/fixtures/development/15_award_emoji.rb
index e195da931ed..1db10f5f0b6 100644
--- a/db/fixtures/development/15_award_emoji.rb
+++ b/db/fixtures/development/15_award_emoji.rb
@@ -1,10 +1,10 @@
Gitlab::Seeder.quiet do
emoji = Gitlab::AwardEmoji.emojis.keys
-
- Issue.all.each do |issue|
+ issue_count = Issue.count / 2
+ Issue.order("RANDOM()").limit(Issue.count / 2).each do |issue|
project = issue.project
- project.team.users.sample(2) do |user|
+ project.team.users.sample(2).each do |user|
issue.create_award_emoji(emoji.sample, user)
issue.notes.sample(2).each do |note|
@@ -16,7 +16,7 @@ Gitlab::Seeder.quiet do
end
end
- MergeRequest.all.each do |mr|
+ MergeRequest.order("RANDOM()").limit(MergeRequest.count / 2).each do |mr|
project = mr.project
project.team.users.sample(2).each do |user|