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