Sha256: 606d3e7da4cc3730acc0f8c08b05a12232f107ae4419f12068e48c38d219b19e

Contents?: true

Size: 694 Bytes

Versions: 8

Compression:

Stored size: 694 Bytes

Contents

User.find(:all).each do |user|
  if user.plugins.find_by_name('<%= class_name.pluralize.underscore.downcase %>').nil?
    user.plugins.create(:name => '<%= class_name.pluralize.underscore.downcase %>',
                        :position => (user.plugins.maximum(:position) || -1) +1)
  end
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

8 entries across 8 versions & 1 rubygems

Version Path
refinerycms-generators-1.0.0 lib/generators/refinery_engine/templates/db/seeds/plural_name.rb
refinerycms-generators-0.9.9.6 lib/generators/refinery_engine/templates/db/seeds/plural_name.rb
refinerycms-generators-0.9.9.5 lib/generators/refinery_engine/templates/db/seeds/plural_name.rb
refinerycms-generators-0.9.9.4 lib/generators/refinery_engine/templates/db/seeds/plural_name.rb
refinerycms-generators-0.9.9.3 lib/generators/refinery_engine/templates/db/seeds/plural_name.rb
refinerycms-generators-0.9.9.2 lib/generators/refinery_engine/templates/db/seeds/plural_name.rb
refinerycms-generators-0.9.9.1 lib/generators/refinery_engine/templates/db/seeds/plural_name.rb
refinerycms-generators-0.9.9 lib/generators/refinery_engine/templates/db/seeds/plural_name.rb