I'm trying to figure out how to model an activity stream for a social
site im building and I don't really know what's the best way to do it.

Have a FeedItem model with each row referencing a model (Post,
Comment, etc) so it would be something like the following:

class FeedItem
  include DataMapper::Resource
  property :user_id, Integer  #user who performed the action
  property :feed_item_class, Class
  property :feed_item_id, Integer
end

and then I would have to write a method that queries each
feed_item_class and then combines the results of each query into one
array.

OR have a FeedIten model that has a yaml property that contains the
data related to that feed item:

class FeedItem
  include DataMapper::Resource
  property :user_id, Integer #user who performed the action
  property :feed_item_class, Class
  property :feed_item_id, Integer
  property :data, Yaml
end

So for instance: FeedItem.create(:user_id => 1, :feed_item_class =>
Comment, :feed_item_id => 42, :data => "{body: blah}"


Any help would be appreciated.

-bryan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to