-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
40 lines (36 loc) · 1.32 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
require 'mongo_mapper'
require File.join(File.dirname(__FILE__), '/lib/ten_percent_news')
desc "Add some stories to the db"
task :add_stories do
if ENV && ENV['MONGOHQ_URL']
MongoMapper.setup({'production' => {'uri' => ENV['MONGOHQ_URL']}}, 'production')
else
MongoMapper.connection = Mongo::Connection.new('localhost', '27017')
MongoMapper.database = 'ten_percent_dev'
end
Story.destroy_all
story = Story.new(title: 'Fire at Glasgow art school')
story.snippets.build({
picture_url: 'images/pic1.png',
picture_alt: 'Glasgow School of Art',
text: "There has been a fire in the Glasgow School of Art damaging a famous library."
})
story.snippets.build({
picture_url: 'images/pic1.png',
picture_alt: 'Glasgow School of Art',
text: "There has been a fire in the Glasgow School of Art damaging a famous library."
})
story.save!
story = Story.new(title: 'Fire at Glasgow art school')
story.snippets.build({
picture_url: 'images/pic1.png',
picture_alt: 'Glasgow School of Art',
text: "There has been a fire in the Glasgow School of Art damaging a famous library."
})
story.snippets.build({
picture_url: 'images/pic1.png',
picture_alt: 'Glasgow School of Art',
text: "There has been a fire in the Glasgow School of Art damaging a famous library."
})
story.save!
end