Commit 7dc08033 authored by Z.J. van de Weg's avatar Z.J. van de Weg

Near half of the Issues get Award Emoji when seeding

parent bd3324cc
Gitlab::Seeder.quiet do Gitlab::Seeder.quiet do
emoji = Gitlab::AwardEmoji.emojis.keys emoji = Gitlab::AwardEmoji.emojis.keys
issue_count = Issue.count / 2
Issue.all.each do |issue| Issue.order("RANDOM()").limit(Issue.count / 2).each do |issue|
project = issue.project 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.create_award_emoji(emoji.sample, user)
issue.notes.sample(2).each do |note| issue.notes.sample(2).each do |note|
...@@ -16,7 +16,7 @@ Gitlab::Seeder.quiet do ...@@ -16,7 +16,7 @@ Gitlab::Seeder.quiet do
end end
end end
MergeRequest.all.each do |mr| MergeRequest.order("RANDOM()").limit(MergeRequest.count / 2).each do |mr|
project = mr.project project = mr.project
project.team.users.sample(2).each do |user| project.team.users.sample(2).each do |user|
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment