Class: Workarea::CustomerServicePagesSeeds

Inherits:
Object
  • Object
show all
Defined in:
app/seeds/workarea/customer_service_pages_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
21
22
23
24
25
26
27
28
29
30
31
# File 'app/seeds/workarea/customer_service_pages_seeds.rb', line 3

def perform
  puts 'Adding auxiliary pages...'

  Content::Page.create!(
    name: 'Shipping Policy',
    tag_list: 'customer service'
  )

  Content::Page.create!(
    name: 'Returns',
    tag_list: 'customer service'
  )

  Content::Page.create!(
    name: 'Credit Card Security Code'
  )

  internal_error_page = Content.for('Internal Server Error')
  internal_error_page.save!

  not_found_content = Content.for('Not Found')
  not_found_content.blocks.build(
    type: :html,
    data: {
      html: '<p>Try searching or <a href="/">start at the home page</a>.</p>'
    }
  )
  not_found_content.save!
end