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

fix

parent 359cc96a
No related branches found
No related tags found
No related merge requests found
......@@ -29,12 +29,14 @@ class Communication::Block::Template::Post < Communication::Block::Template
def free_posts
array = []
elements.map do |element|
id = element['id']
next if id.blank?
post = block.about&.website.posts.find_by id: id
next if post.nil?
array << post
array << post(element['id'])
end
array.compact!
array
end
def post(id)
return if id.blank?
block.about&.website.posts.find_by id: id
end
end
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