Hi everyone.
I’m writing the admin area of a website, which has several users. The id
of
the current user is stored in the session. There are several models that
the
user can edited (article, link, customer etc), and whenever a user edits
a
model I would like to record this fact in a textfield of the model, so
that
lists of the various models can display who last edited them. I wrote a
module to include into each model that wants this behaviour, but then I
realised I can’t get at the user_id from the model, and that I would
have to
go edit all my controllers, passing in the user_id to each different
model
wherever an instance is created. This is obviously hairy duplication,
and
I’m sure there is a clever way to factor it out, I just can’t see where.
Cheers.
Robie