You could do it as a classy_module and add your tracking code in there
with after_create and after_save callbacks.  Though for tracking who
does updates if you want that level of logging you might want to look
at making a change/version log.


On Jul 26, 9:37 am, Skott Klebe <[email protected]> wrote:
> Hi, all.
>
> I'm working with a data model in which every table has cre_usr and
> upd_usr fields, to be filled in with the name of a logged-in user
> whenever a row is created or updated.
>
> I tried to create an abstract BaseModel class to supply a default
> before_validation_on_create, using self.abstract_class = true;
> however, it appears that Hobo doesn't look at abstract_class, because
> I get TABLE BaseModel does not exist.  This would be my preferred
> approach, since it seems DRY-er than anything else.
>
> Second best would be to employ :creator => true  in every hobo_model,
> but I don't see any equivalent that would fire only on update.  I also
> don't see a way to customize the column names that receive the
> acting_user value.
>
> Any ideas on how to move forward?  What's the best way to do this?
> SK
> --
> Skott Klebe
> [email protected]

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" 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/hobousers?hl=en.

Reply via email to