Streamit (Under development)

Provides feed stream like feature to rails apps

stream.rb

class Stream
  include MongoMapper::Document
  include Streamit::ORM::MongoMapper
end

“he9lin started watching auction ipad a minute ago”

en.yml

en:
  streamit:
    watching:
      create: "started watching"

watching.rb

class Watching < ActiveRecord::Base
  belongs_to :watcher,      :class_name => "User", :foreign_key => "user_id"
  belongs_to :watched_item, :class_name => "Item", :foreign_key => "item_id"

  stream :create, :actor    => :watcher,
                  :receiver => :watched_item
end

“he9lin edited profile image just now”

en.yml

en:
  streamit:
    users:
      update:
        image_url: "edited profile image"

user.rb

class User < ActiveRecord::Base
  stream :update, :attributes => :image_url
end