Skip to content
Snippets Groups Projects
Commit 7bcfbff0 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

fix

parent 2418401f
No related branches found
No related tags found
No related merge requests found
......@@ -6,17 +6,17 @@ module WithBlocks
has_many :headings, as: :about, class_name: 'Communication::Block::Heading', dependent: :destroy
end
def content
unless @content
@content = []
def contents
unless @contents
@contents = []
blocks.without_heading.published.ordered.each do |block|
@content << block
@contents << block
end
headings.ordered.each do |heading|
@content << heading
@contents << heading
end
end
@content
@contents
end
# Basic rule is: TOC if 2 titles or more
......
json.contents about.content do |block_or_heading|
json.contents about.contents do |block_or_heading|
if block_or_heading.is_a? Communication::Block
json.partial! 'admin/communication/blocks/static', block: block_or_heading
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment