Skip to content

How to add new activity types

atd edited this page Apr 17, 2012 · 4 revisions

Social Stream allows developers to write and integrate different models that grant the users with new kind of activities.

Activity types already available

There are already gems that add new activity types to social_stream-base (for instance social_stream-documents) These gems automatically integrate new activity types with the rest of Social Stream, for instance, in the new activity form, the search engine, etc.

However, these aspects can be customized in the file config/initializer/social_stream.rb, which should be copied to your application in the install rake task, and should look like the file at https://github.com/ging/social_stream/blob/master/base/lib/generators/social_stream/base/templates/initializer.rb

Creating new activity types

For adding new features on social_stream with diferent activities, remember:

  • All activities' models should include SocialStream::Modules::Object and include an activity_object_id integer field in their table.

  • Include them in config/initializer/social_strem.rb so they are available in for forms, search engine, etc. See the application' config/initializer/social_strem.rb for more details.