I’m writing a wiki-based website from scratch and would like some
suggestions on the best way to deal with this common situation. A page
can be edited by a logged-in and registered user or by an anonymous
visitor. If a user edits the page, the model object representing the
edit is associated with a user via a user_id foreign key. But if an
anonymous visitor can edit the page too, what’s the best way to model
this?
One idea I’m entertaining is to make a polymorphic relationship
between the edit or page version and two different classes: a User
class and an AnonymousVisitor class. But I’m not sure.
Thanks in advance for your tips and suggestions.