Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
58b68954
Commit
58b68954
authored
Aug 09, 2018
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add mock data for spam logs
Closes
https://gitlab.com/gitlab-org/gitlab-development-kit/issues/387
parent
be1ef711
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
db/fixtures/development/23_spam_logs.rb
db/fixtures/development/23_spam_logs.rb
+32
-0
No files found.
db/fixtures/development/23_spam_logs.rb
0 → 100644
View file @
58b68954
# frozen_string_literal: true
module
Db
module
Fixtures
module
Development
class
SpamLog
def
self
.
seed
Gitlab
::
Seeder
.
quiet
do
(
::
SpamLog
.
default_per_page
+
3
).
times
do
|
i
|
::
SpamLog
.
create
(
user:
self
.
random_user
,
user_agent:
FFaker
::
Lorem
.
sentence
,
source_ip:
FFaker
::
Internet
.
ip_v4_address
,
title:
FFaker
::
Lorem
.
sentence
,
description:
FFaker
::
Lorem
.
paragraph
,
via_api:
FFaker
::
Boolean
.
random
,
submitted_as_ham:
FFaker
::
Boolean
.
random
,
recaptcha_verified:
FFaker
::
Boolean
.
random
)
print
'.'
end
end
end
def
self
.
random_user
User
.
find
(
User
.
pluck
(
:id
).
sample
)
end
end
end
end
end
Db
::
Fixtures
::
Development
::
SpamLog
.
seed
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment