Class: Workarea::BlogSeeds
- Inherits:
-
Object
- Object
- Workarea::BlogSeeds
- Defined in:
- app/seeds/workarea/blog_seeds.rb
Instance Method Summary collapse
- #add_blog_navigation ⇒ Object
- #add_blogs_index ⇒ Object
- #add_taxonomy_content_block(blog_root) ⇒ Object
- #create_landing_page_content ⇒ Object
- #perform ⇒ Object
Instance Method Details
#add_blog_navigation ⇒ Object
29 30 31 32 33 34 35 36 37 38 |
# File 'app/seeds/workarea/blog_seeds.rb', line 29 def blog_root = add_blogs_index blogs = Workarea::Content::Blog.all blogs.each do |blog| blog_root.children.create!(navigable: blog) end add_taxonomy_content_block(blog_root) end |
#add_blogs_index ⇒ Object
40 41 42 |
# File 'app/seeds/workarea/blog_seeds.rb', line 40 def add_blogs_index Navigation::Taxon.root.children.create!(name: 'Blog', url: '/blogs') end |
#add_taxonomy_content_block(blog_root) ⇒ Object
44 45 46 47 48 49 50 51 |
# File 'app/seeds/workarea/blog_seeds.rb', line 44 def add_taxonomy_content_block(blog_root) = Navigation::Menu.create!(taxon: blog_root) content = Content.for() content.blocks.create!( type: 'taxonomy', data: { start: blog_root.id.to_s } ) end |
#create_landing_page_content ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/seeds/workarea/blog_seeds.rb', line 15 def create_landing_page_content landing_page_content = Workarea::Content.for('Blog Landing Page') landing_page_content.blocks.create!( area: 'header_content', type: 'text', data: { text: Faker::Hipster.paragraph(4) } ) landing_page_content.save! end |