Skip to content

A simple gem for adding an activity feed to an ActiveRecord object

Notifications You must be signed in to change notification settings

golov/has_redis_feed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HasRedisFeed

HasRedisFeed is a simple way of setting and getting feeds for your ActiveRecord objects.

Prerequisites

HasRedisFeed assumes that you have Redis connected to the $redis global variable.

Usage

Add to feed

user = User.create
user.push_to_feed({:message => 'old message'})
user.push_to_feed({:message => 'new message'})
user.feed 
# => [{"message"=>"new message"}, {"message"=>"old message"}] 

The feed will be created with namespace

feed:class.name:id

So in this case (with user id 1):

feed:#{class.name}:#{id}

About

A simple gem for adding an activity feed to an ActiveRecord object

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages