wordpress-import/spec/dummy/db/seeds/refinerycms_blog.rb
Marc Remolt a24ea686fa Image import working
* bundle update
* replacement of image URLs now considers wordpress thumbnails (like -150x150)
* added Guard for autotesting
2011-06-13 15:02:40 +02:00

20 lines
637 B
Ruby

::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?(::User)
if defined?(::Page)
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
end