francois / timeline_fu forked from jamesgolick/timeline_fu

This URL has Read+Write access

francois (author)
Tue Dec 09 19:37:29 -0800 2008
commit  4ace4cc134a7b48a56d9209f6f39e53c531c78c6
tree    eb7ac5506f4f3382f2902a0976cbed135b82129a
parent  e6d0db3d7ea709515231848ed0be418984bff642
name age message
file MIT-LICENSE Tue Dec 09 10:38:39 -0800 2008 Attribution for license [francois]
file README Loading commit data...
file Rakefile
file init.rb Tue Sep 30 14:10:46 -0700 2008 import extracted timeline_fu plugin [jamesgolick]
directory lib/
directory test/
README
TimelineFu
==========

Easily build timelines, much like GitHub's news feed.

Requirements
============

You'll need a TimelineEvent class, which TimelineFu will use.  The name is hard-coded.

Your TimelineEvent model will receive the following parameters in #create!

* event_type
* target
* secondary_target
* actor

It is your responsibility as the developer to correctly associate the objects
to your columns (or however you're storing them).  You could associate
polymorphically using this:

 class TimelineEvent < ActiveRecord::Base
   belongs_to :target,            :polymorphic => true
   belongs_to :secondary_target,  :polymorphic => true
   belongs_to :actor,             :polymorphic => true
 end

For each object that can be a target of events, make it an event target:

 class Commit < ActiveRecord::Base
   acts_as_event_target
 end

 class Comment < ActiveRecord::Base
   acts_as_event_target
 end

 class Repository < ActiveRecord::Base
   acts_as_event_target
 end

Copyright (c) 2008 James Golick, released under the MIT license