Class: Workarea::ContentBlockPageSeeds

Inherits:
Object
  • Object
show all
Defined in:
app/seeds/workarea/content_block_page_seeds.rb

Instance Method Summary collapse

Instance Method Details

#performObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/seeds/workarea/content_block_page_seeds.rb', line 3

def perform
  puts "Adding content blocks page..."
  page = Content::Page.create!(
    name: "Content Blocks"
  )
  content = Content.for(page)

  Workarea.config.content_block_types.each do |block_type|
    unless block_type.tags.include?("taxonomy")
      content.blocks.build(
        type: block_type,
        data: block_type.defaults
      )
    end
  end

  content.save!
end