Sha256: 3adbf9b371bc616b5726d2f392e217a0293938356c5b50c9e5dca19e38583b01
Contents?: true
Size: 708 Bytes
Versions: 2
Compression:
Stored size: 708 Bytes
Contents
if defined?(::User) User.all.each do |user| if user.plugins.where(:name => 'refinerycms_news').blank? user.plugins.create(:name => 'refinerycms_news', :position => (user.plugins.maximum(:position) || -1) +1) end end end if defined?(::Page) unless Page.where(:menu_match => "^/news.*$").any? page = Page.create( :title => "News", :link_url => "/news", :deletable => false, :position => ((Page.maximum(:position, :conditions => {:parent_id => nil}) || -1)+1), :menu_match => "^/news.*$" ) Page.default_parts.each do |default_page_part| page.parts.create(:title => default_page_part, :body => nil) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
refinerycms-news-1.2.0 | db/seeds/refinerycms_news.rb |
refinerycms-news-1.1.0 | db/seeds/refinerycms_news.rb |