aboutsummaryrefslogblamecommitdiffstats
path: root/db/seeds.rb
blob: e0a8b7df788e4f6588b3fb48cc89634dca2ef6bb (plain) (tree)
1
2
3
4
5
6
7
8
9
                                        



                                                                                
                               
 

                               


                         
                                                                                                   

                                         
 
                                                          

                                                                







                                                               
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# Refinery seeds
Dir[Rails.root.join('db', 'seeds', '*.rb').to_s].each do |file|
  puts "Loading db/seeds/#{file.split(File::SEPARATOR).last}"
  load(file)
end

# Added by RefineryCMS Pages engine
Refinery::Pages::Engine.load_seed