diff options
author | Z.J. van de Weg <zegerjan@gitlab.com> | 2016-06-10 13:31:42 +0200 |
---|---|---|
committer | Z.J. van de Weg <zegerjan@gitlab.com> | 2016-06-15 11:55:41 +0200 |
commit | 7dc08033b9cbd2876ed444878525d9f8bbfcef64 (patch) | |
tree | d5e1461eac0703c5ec6254e52b0d92419f283b6c /db | |
parent | bd3324cca2fefb00e421c4dc1fb276db540d08bd (diff) | |
download | gitlab-ce-7dc08033b9cbd2876ed444878525d9f8bbfcef64.tar.gz |
Near half of the Issues get Award Emoji when seeding
Diffstat (limited to 'db')
-rw-r--r-- | db/fixtures/development/15_award_emoji.rb | 8 |
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| |