From 7663b1c561315d28a67608719626c583798323f4 Mon Sep 17 00:00:00 2001 From: yo-gen Date: Tue, 24 Apr 2018 12:02:54 +0530 Subject: [PATCH] Update Readme.md to document enrichment for aggregated_activity Document the enrich_aggregated_activities method as it is hard to find for for new users. Provide a small usage example similar to the enrich_activities one. --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 91171f4..42d7727 100644 --- a/README.md +++ b/README.md @@ -343,6 +343,14 @@ feed = StreamRails.feed_manager.get_news_feeds(current_user.id)[:flat] results = feed.get()['results'] activities = enricher.enrich_activities(results) ``` +A similar method called enrich_aggregated_activities is available for aggregated feeds. +```ruby +enricher = StreamRails::Enrich.new + +feed = StreamRails.feed_manager.get_news_feeds(current_user.id)[:aggregated] +results = feed.get()['results'] +activities = enricher.enrich_aggregated_activities(results) +``` If you have additional metadata in your activity (by overriding `activity_extra_data` in the class where you add the Stream Activity mixin), you can also enrich that field's data by doing the following: