tadyjp/rendezvous

View on GitHub
app/decorators/posts_decorator.rb

Summary

Maintainability
A
0 mins
Test Coverage
class PostsDecorator < Draper::CollectionDecorator
  def related_tags
    tags = map(&:tags).flatten.uniq.take(10)

    TagDecorator.decorate_collection(tags)
  end

  def related_authors
    map(&:author).flatten.uniq.map(&:decorate)
  end
end