From 5a958007c5c4b3ef4af001464d75c4c00adfe870 Mon Sep 17 00:00:00 2001 From: Jamie Winsor Date: Thu, 27 Oct 2011 18:12:32 -0700 Subject: Update blog generator to use Rails 3.1 base Seeds will now follow Rails 3.1 conventions --- db/seeds.rb | 20 ++++++++++++++++++++ db/seeds/refinerycms_blog.rb | 20 -------------------- 2 files changed, 20 insertions(+), 20 deletions(-) create mode 100644 db/seeds.rb delete mode 100644 db/seeds/refinerycms_blog.rb (limited to 'db') 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 diff --git a/db/seeds/refinerycms_blog.rb b/db/seeds/refinerycms_blog.rb deleted file mode 100644 index 19c4370..0000000 --- a/db/seeds/refinerycms_blog.rb +++ /dev/null @@ -1,20 +0,0 @@ -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 -- cgit v1.2.3