Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-07-18 14:08:48 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-07-18 14:08:48 +0400
commitbbb06e504e387762bb5a073d1f0debdc05e03f98 (patch)
tree7c27bb8662bbd3bd0c90bc13290a1171fe804ad0 /db/fixtures/development
parent02e39563c8e931c94a650f36d8732beecc068019 (diff)
Add seeds and improve ui. Remove snippet expires_at
Diffstat (limited to 'db/fixtures/development')
-rw-r--r--db/fixtures/development/12_snippets.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/db/fixtures/development/12_snippets.rb b/db/fixtures/development/12_snippets.rb
new file mode 100644
index 00000000000..78f24446a88
--- /dev/null
+++ b/db/fixtures/development/12_snippets.rb
@@ -0,0 +1,24 @@
+ActiveRecord::Base.observers.disable :all
+
+Gitlab::Seeder.quiet do
+ contents = [
+ `curl https://gist.github.com/randx/4275756/raw/da2f262920c96d1a970d48bf2e99147954b1f4bd/glus1204.sh`,
+ `curl https://gist.github.com/randx/3754594/raw/11026a295e6ef3a151c635707a3e1e8e15fc4725/gitlab_setup.sh `,
+ `curl https://gist.github.com/randx/3065552/raw/29fbd09f4605a5ea22a5a9095e35fd1938dea4d6/gistfile1.sh`,
+ ]
+
+ (1..50).each do |i|
+ user = User.all.sample
+
+ PersonalSnippet.seed(:id, [{
+ id: i,
+ author_id: user.id,
+ title: Faker::Lorem.sentence(6),
+ file_name: Faker::Internet.domain_word + '.sh',
+ private: [true, false].sample,
+ content: contents.sample,
+ }])
+ print('.')
+ end
+end
+