Sha256: 1742aa1697e86c9754ec5d884467fe5b962e84d49fec4c7d2e1747601324504b
Contents?: true
Size: 856 Bytes
Versions: 62
Compression:
Stored size: 856 Bytes
Contents
module Workarea class BrowsingPagesSeeds def perform puts 'Adding browsing pages...' Workarea.config.default_seeds_taxonomy.each do |top_level, children| page = Content::Page.create!(name: top_level, tag_list: 'browsing') content = Content.for(page) children.each do |category| content.blocks.build( type: :category_summary, data: { category: Catalog::Category.find_by(name: category).id } ) end content.save! end end # TODO remove in v3.5 as this is no longer used def find_unique_name department = Faker::Commerce.department(1) pages = Content::Page.all.to_a until pages.select { |p| p.name == department }.empty? department = Faker::Commerce.department(1) end department end end end
Version data entries
62 entries across 62 versions & 1 rubygems
Version | Path |
---|---|
workarea-core-3.4.13 | app/seeds/workarea/browsing_pages_seeds.rb |
workarea-core-3.4.12 | app/seeds/workarea/browsing_pages_seeds.rb |