Bryan wrote:
> 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.
>
> [First Option, polymorphic]
>
> OR have a FeedIten model that has a yaml property that contains the
> data related to that feed item:
do this. Generally activity streams see pretty high activity (say, coz
they're on the user's home page), you want that query to be a single
select out of a table. In this case, the feed_item_* are not strictly
necessary (though still recommend for chasing problems).
>
> 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
-~----------~----~----~----~------~----~------~--~---