Sha256: 4b1011fb7247fa320cecb1367794ed4bb044a6b1cb65960aae1436dfcf2ea6c4

Contents?: true

Size: 846 Bytes

Versions: 9

Compression:

Stored size: 846 Bytes

Contents

Refinery::I18n.frontend_locales.each do |lang|
  I18n.locale = lang

  Refinery::User.find_each do |user|
    user.plugins.where(name: 'refinerycms-<%= namespacing.underscore %>').first_or_create!(
      position: (user.plugins.maximum(:position) || -1) +1
    )
  end if defined?(Refinery::User)

<% unless skip_frontend? -%>
  Refinery::Page.where(link_url: (url = "/<%= [(namespacing.underscore if namespacing.underscore != plural_name), plural_name].compact.join('/') %>")).first_or_create!(
    title: '<%= class_name.pluralize.underscore.titleize %>',
    deletable: false,
    menu_match: "^#{url}(\/|\/.+?|)$"
  ) do |page|
    Refinery::Pages.default_parts.each_with_index do |part, index|
      page.parts.build title: part[:title], slug: part[:slug], body: nil, position: index
    end
  end if defined?(Refinery::Page)
<% end -%>
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
refinerycms-core-4.0.3 lib/generators/refinery/engine/templates/db/seeds.rb.erb
refinerycms-core-4.0.2 lib/generators/refinery/engine/templates/db/seeds.rb.erb
refinerycms-core-4.0.1 lib/generators/refinery/engine/templates/db/seeds.rb.erb
refinerycms-core-3.0.6 lib/generators/refinery/engine/templates/db/seeds.rb.erb
refinerycms-core-4.0.0 lib/generators/refinery/engine/templates/db/seeds.rb.erb
refinerycms-core-3.0.5 lib/generators/refinery/engine/templates/db/seeds.rb.erb
refinerycms-core-3.0.4 lib/generators/refinery/engine/templates/db/seeds.rb.erb
refinerycms-core-3.0.3 lib/generators/refinery/engine/templates/db/seeds.rb.erb
refinerycms-core-3.0.2 lib/generators/refinery/engine/templates/db/seeds.rb.erb