aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@andeuin.net>2014-02-06 15:41:13 +0100
committerHarald Eilertsen <haraldei@andeuin.net>2014-02-06 15:41:13 +0100
commiteef973923042a20d90dd66fa653bd97e12126780 (patch)
treebab853d167eeff8ca11961f1daa3d256052a6753 /lib
parente0e494a649943c8228360ceb90e4fd34c280339d (diff)
downloadhmnoweb-eef973923042a20d90dd66fa653bd97e12126780.tar.gz
hmnoweb-eef973923042a20d90dd66fa653bd97e12126780.tar.bz2
hmnoweb-eef973923042a20d90dd66fa653bd97e12126780.zip
Make sample data nicer.
- Wrap text in simple html. - Assign sidebar position to categories.
Diffstat (limited to 'lib')
-rw-r--r--lib/tasks/dev_load_sample_data.rake9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/tasks/dev_load_sample_data.rake b/lib/tasks/dev_load_sample_data.rake
index 81084e6..c9333b9 100644
--- a/lib/tasks/dev_load_sample_data.rake
+++ b/lib/tasks/dev_load_sample_data.rake
@@ -9,17 +9,22 @@ namespace :dev do
task :create_blog_categories => [:environment] do
cats = %w{ Nyheter Intervjuer Anmeldelser Artikler }
cats.each do |cat|
- Refinery::Blog::Category.create(:title => cat)
+ pos = 0
+ pos = 1 if cat == "Nyheter"
+ pos = 2 if cat == "Anmeldelser"
+ Refinery::Blog::Category.create(:title => cat, :sidebar_position => pos)
end
end
task :create_blog_posts => [:environment, :create_blog_categories, :create_sample_user] do
+ include ActionView::Helpers
+
cats = Refinery::Blog::Category.all
user = Refinery::User.find_by_username("sample user")
cats.each do |cat|
(1..5).each do |n|
p = Refinery::Blog::Post.new(:title => "#{cat.title} post #{n}",
- :body => Lorem::Base.new(:paragraphs, 5).output,
+ :body => simple_format(Lorem::Base.new(:paragraphs, 5).output),
:user_id => user.id,
:draft => false)
p.published_at = DateTime.now