Create a FeedItem model for the User which is responsible for populating his newsfeed
authorJohan Sørensen <johan@johansorensen.com>
Wed, 9 Dec 2009 15:29:50 +0000 (16:29 +0100)
committerJohan Sørensen <johan@johansorensen.com>
Wed, 9 Dec 2009 15:35:06 +0000 (16:35 +0100)
commitcf1403fdc529ca9114522d0b0c70b09c1c2f8c0f
treed3550b537277c6d1da22743c299f1e8d4c62054d
parentd0d267d27c3cdbf96859f9c58d55a5e37516f9f9
Create a FeedItem model for the User which is responsible for populating his newsfeed

The FeedItem is a simple pseudo-join model between a User and the
Events he needs to see in his newsfeed. By having it in a seperate
table we can use it as an index of sorts to figure out which events he
needs to see.

The FeedItems are populated in a bulk manner after an Event is created
by figuring out who watches (through Favorite) the object the Event
belong to. The FeedItem not only makes the finding of watched events
faster, it also allows us to insert things into the event that we
cannot do through a straight join between favorites and events.
app/models/event.rb
app/models/feed_item.rb [new file with mode: 0644]
app/models/project.rb
app/models/user.rb
db/migrate/20091209140335_create_feed_items.rb [new file with mode: 0644]
db/schema.rb
test/fixtures/feed_items.yml [new file with mode: 0644]
test/unit/event_test.rb
test/unit/feed_item_test.rb [new file with mode: 0644]
test/unit/user_test.rb