ruby on rails - How to approach aggregating actvities in feeds and then handling comments -
i'm working on developing activity stream running club i'm working with. runners able see fun , things , friends have been on past few weeks.
obie fernandez gave great talk on how approach using redis @ railsconf 2012 (the videos on youtube here) , i've adapted work within our app.
having run few days, it's clear next challenge build aggregated items list now. take example following feed:
here it's clear top story better collapse "shaun, alexander , ivo completed group run...", poses interesting question when thinking comments. comment associated individuals action of going on run. comment on ivo's attendance on run directed @ him. in collapsing story, i'm not entirely sure how handle commenting. comment gets distributed amongst people you're friends went on run, can see becoming messy when people have different sets of friends. comments instead link directly run itself, lose value of being able reference particular user's attendance.
i'd love hear people's thoughts on this, , pointers design patterns out there handling this.
i'd think feed_item
(for display purposes) having_many feedables
in polymorphic relationship. is, many things have created feed_item
(a run, bike ride, connecting new friend feedable
s , generate feed_item
)
the run above 3 runs associated 1 feed_item
, , feed_item
have many comments
, not feedable
(run or whatever).
this isolates record of our group run record of our group run, when leave service, run persists because feed_item
still there, lost feedable
run.
batching them , associating take fuzzy logic that's different issue, helps out commenting , cannonical source being feed_item
separate feedable
s (runs, bikes, etc)
Comments
Post a Comment