diff options
author | Z.J. van de Weg <zegerjan@gitlab.com> | 2016-06-09 10:54:43 +0200 |
---|---|---|
committer | Z.J. van de Weg <zegerjan@gitlab.com> | 2016-06-15 11:55:41 +0200 |
commit | 080cbcabd96b27e300b3a85e11399d3f4449d335 (patch) | |
tree | 29887d857319e4ef3a7ee829f881fecb107b644e /db/fixtures | |
parent | d8563bd6c2408efb6890c536ed0852b99fa49423 (diff) | |
download | gitlab-ce-080cbcabd96b27e300b3a85e11399d3f4449d335.tar.gz |
Seed Award Emoji while seeding the database
Diffstat (limited to 'db/fixtures')
-rw-r--r-- | db/fixtures/development/15_award_emoji.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/db/fixtures/development/15_award_emoji.rb b/db/fixtures/development/15_award_emoji.rb new file mode 100644 index 00000000000..3ac3fea43a5 --- /dev/null +++ b/db/fixtures/development/15_award_emoji.rb @@ -0,0 +1,27 @@ +Gitlab::Seeder.quiet do + emoji = Gitlab::AwardEmoji.emojis.keys + + Issue.all.each do |issue| + project = issue.project + + project.team.users.sample(2) do |user| + issue.create_award_emoji(emoji.sample, user) + + note = issue.notes.sample + note.create_award_emoji(emoji.sample, user) + print '.' + end + end + + MergeRequest.all.each do |mr| + project = mr.project + + project.team.users.sample(2).each do |user| + mr.create_award_emoji(emoji.sample, user) + + note = mr.notes.sample + note.create_award_emoji(emoji.sample, user) + print '.' + end + end +end |