Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. def with_highrated_related_content
  2. name = __method__.to_s.humanize
  3. collection = Content::TYPES.inject([]) do |recommendation_collection, content_type|
  4. items = @recommendations_aggregator.with_highrated_related_content(content_type)
  5. recommendation_collection << decorate_content_related_hash(content_type, items)
  6. end
  7. decorate_content_related_collection(name, collection)
  8. end
  9.  
  10. def with_liked_related_content(user)
  11. name = __method__.to_s.humanize
  12. collection = Content::TYPES.inject([]) do |recommendation_collection, content_type|
  13. items = @recommendations_aggregator.with_liked_related_content(user, content_type)
  14. recommendation_collection << decorate_content_related_hash(content_type, items)
  15. end
  16. decorate_content_related_collection(name, collection)
  17. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement