Sha256: b1adca31b00097125cc10b6e7a4a4a6971391181de46751b7d9f9e0167fb621f

Contents?: true

Size: 597 Bytes

Versions: 4

Compression:

Stored size: 597 Bytes

Contents

User.find(:all).each do |user|
  user.plugins.create(:name => "<%= class_name.pluralize.underscore.downcase %>",
                      :position => (user.plugins.maximum(:position) || -1) +1)
end

page = Page.create(
  :title => "<%= class_name.pluralize.underscore.titleize %>",
  :link_url => "/<%= plural_name %>",
  :deletable => false,
  :position => ((Page.maximum(:position, :conditions => {:parent_id => nil}) || -1)+1),
  :menu_match => "^/<%= plural_name %>(\/|\/.+?|)$"
)
Page.default_parts.each do |default_page_part|
  page.parts.create(:title => default_page_part, :body => nil)
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
refinerycms-0.9.8.9 vendor/refinerycms/core/lib/generators/refinery_engine/templates/db/seeds/plural_name.rb
refinerycms-0.9.8.8 vendor/refinerycms/core/lib/generators/refinery_engine/templates/db/seeds/plural_name.rb
refinerycms-0.9.8.7 vendor/refinerycms/core/lib/generators/refinery_engine/templates/db/seeds/plural_name.rb
refinerycms-0.9.8.6 vendor/refinerycms/core/lib/generators/refinery_engine/templates/db/seeds/plural_name.rb