aboutsummaryrefslogtreecommitdiffstats
path: root/lib/generators/refinerycms_blog/templates/db/seeds
diff options
context:
space:
mode:
Diffstat (limited to 'lib/generators/refinerycms_blog/templates/db/seeds')
-rw-r--r--lib/generators/refinerycms_blog/templates/db/seeds/seed.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/generators/refinerycms_blog/templates/db/seeds/seed.rb b/lib/generators/refinerycms_blog/templates/db/seeds/seed.rb
new file mode 100644
index 0000000..f958fab
--- /dev/null
+++ b/lib/generators/refinerycms_blog/templates/db/seeds/seed.rb
@@ -0,0 +1,16 @@
+User.find(:all).each do |user|
+ user.plugins.create(:name => "refinerycms_blog",
+ :position => (user.plugins.maximum(:position) || -1) +1)
+end
+
+page = Page.create(
+ :title => "Blog",
+ :link_url => "/blog",
+ :deletable => false,
+ :position => ((Page.maximum(:position, :conditions => {:parent_id => nil}) || -1)+1),
+ :menu_match => "^/blogs?(\/|\/.+?|)$"
+)
+
+Page.default_parts.each do |default_page_part|
+ page.parts.create(:title => default_page_part, :body => nil)
+end