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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
32d0bf3a
Commit
32d0bf3a
authored
Oct 16, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix snippets seeds
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
d6fdca9a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
8 deletions
+26
-8
db/fixtures/development/12_snippets.rb
db/fixtures/development/12_snippets.rb
+26
-8
No files found.
db/fixtures/development/12_snippets.rb
View file @
32d0bf3a
Gitlab
::
Seeder
.
quiet
do
Gitlab
::
Seeder
.
quiet
do
contents
=
[
content
=<<
eos
`curl https://gist.githubusercontent.com/randx/4275756/raw/da2f262920c96d1a970d48bf2e99147954b1f4bd/glus1204.sh`
,
class Member < ActiveRecord::Base
`curl https://gist.githubusercontent.com/randx/3754594/raw/11026a295e6ef3a151c635707a3e1e8e15fc4725/gitlab_setup.sh`
,
include Notifiable
`curl https://gist.githubusercontent.com/randx/3065552/raw/29fbd09f4605a5ea22a5a9095e35fd1938dea4d6/gistfile1.sh`
,
include Gitlab::Access
]
belongs_to :user
belongs_to :source, polymorphic: true
validates :user, presence: true
validates :source, presence: true
validates :user_id, uniqueness: { scope: [:source_type, :source_id], message: "already exists in source" }
validates :access_level, inclusion: { in: Gitlab::Access.all_values }, presence: true
scope :guests, -> { where(access_level: GUEST) }
scope :reporters, -> { where(access_level: REPORTER) }
scope :developers, -> { where(access_level: DEVELOPER) }
scope :masters, -> { where(access_level: MASTER) }
scope :owners, -> { where(access_level: OWNER) }
delegate :name, :username, :email, to: :user, prefix: true
end
eos
(
1
..
50
).
each
do
|
i
|
(
1
..
50
).
each
do
|
i
|
user
=
User
.
all
.
sample
user
=
User
.
all
.
sample
...
@@ -12,10 +29,11 @@ Gitlab::Seeder.quiet do
...
@@ -12,10 +29,11 @@ Gitlab::Seeder.quiet do
id:
i
,
id:
i
,
author_id:
user
.
id
,
author_id:
user
.
id
,
title:
Faker
::
Lorem
.
sentence
(
3
),
title:
Faker
::
Lorem
.
sentence
(
3
),
file_name:
Faker
::
Internet
.
domain_word
+
'.
sh
'
,
file_name:
Faker
::
Internet
.
domain_word
+
'.
rb
'
,
private:
[
true
,
false
]
.
sample
,
visibility_level:
Gitlab
::
VisibilityLevel
.
values
.
sample
,
content:
content
s
.
sample
,
content:
content
,
}])
}])
print
(
'.'
)
print
(
'.'
)
end
end
end
end
...
...
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