Can anyone tell me if I'm on the right track?  I think this isn't
quite right:

I want to implement an activity log for users.  It'll show them a list
of the objects they've viewed.  I have, of course, many types of
objects in the Rails program.

I've thought that I'd make a log_entries table which would have
a :viewed_object_id and :viewed_object_type.

I'd then like to be able to retrieve all of the viewed objects,
something along the lines:

   user.log_entries.map{|e| e.viewed_object}

And I could display links to them, like:

   link_to obj.to_s, obj

...so, this is a form of STI, but I'm not sure if Rails handles this
kind.  I'm also not sure if this is the best way to implement this
kind of feature.

Thanks for any feedback!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" 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/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to