Sha256: 110b159372c9cad9664804ada02353b5ed0cf8f0a230fb4ab24a859ba483db94

Contents?: true

Size: 637 Bytes

Versions: 9

Compression:

Stored size: 637 Bytes

Contents

::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

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
refinerycms-blog-1.8.0 db/seeds/refinerycms_blog.rb
refinerycms-blog-1.7.0 db/seeds/refinerycms_blog.rb
refinerycms-blog-1.6.2 db/seeds/refinerycms_blog.rb
refinerycms-blog-1.6.1 db/seeds/refinerycms_blog.rb
refinerycms-blog-1.6.0 db/seeds/refinerycms_blog.rb
refinerycms-blog-1.5.2 db/seeds/refinerycms_blog.rb
refinerycms-blog-1.5.1 db/seeds/refinerycms_blog.rb
refinerycms-blog-1.5.0 db/seeds/refinerycms_blog.rb
refinerycms-blog-1.4.0 db/seeds/refinerycms_blog.rb