2020-01-01 13:55:28 +05:30
|
|
|
require './spec/support/sidekiq_middleware'
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2016-06-16 23:09:34 +05:30
|
|
|
Gitlab::Seeder.quiet do
|
2019-12-04 20:38:33 +05:30
|
|
|
def seed_award_emoji(klass)
|
|
|
|
klass.order(Gitlab::Database.random).limit(klass.count / 2).each do |awardable|
|
|
|
|
awardable.project.authorized_users.where('project_authorizations.access_level > ?', Gitlab::Access::GUEST).sample(2).each do |user|
|
2021-12-11 22:18:48 +05:30
|
|
|
AwardEmojis::AddService.new(awardable, TanukiEmoji.index.all.sample.name, user).execute
|
2016-06-16 23:09:34 +05:30
|
|
|
|
2019-12-04 20:38:33 +05:30
|
|
|
awardable.notes.user.sample(2).each do |note|
|
2021-12-11 22:18:48 +05:30
|
|
|
AwardEmojis::AddService.new(note, TanukiEmoji.index.all.sample.name, user).execute
|
2019-12-04 20:38:33 +05:30
|
|
|
end
|
2016-06-16 23:09:34 +05:30
|
|
|
|
2019-12-04 20:38:33 +05:30
|
|
|
print '.'
|
2016-06-16 23:09:34 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2019-12-04 20:38:33 +05:30
|
|
|
seed_award_emoji(Issue)
|
|
|
|
seed_award_emoji(MergeRequest)
|
2016-06-16 23:09:34 +05:30
|
|
|
end
|