Newer
Older
class Communication::Block::Template::Post < Communication::Block::Template
add_dependency [post.author, post.author.author]
@category ||= block.about&.website.categories.find_by(id: data['category_id'])
quantity = data['posts_quantity'] || 3
block.about&.website.posts.ordered.limit(quantity)
end
def post(id)
return if id.blank?
block.about&.website.posts.find_by id: id
end