Matt, Although it can be done like that, my thought is that userstamps should be added to the Hobo model generation, so that everyone gets it automatically.
That is, in the file: vendor/plugins/hobo/hobofields/rails_generators/hobofield_model/templates/model.rb.erb replace "timestamps" with "userstamps". (And add the necessary code to after_create and after_save). Regards, Henry On August 21, 2009 05:51:34 pm Matt Jones wrote: > Well, some of this is already present. If you set an association: > > belongs_to :creator, :class_name => 'User', :creator => true > > It will automatically associate created records to that user. You can > also (I seem to recall) set :creator => true on a string field, which > gets the creating user's name_attribute value. > > I've not seen a lot of use cases for updated_by, but it should be > doable in a before_save callback, I believe. > > --Matt Jones > > On Aug 21, 2009, at 4:26 PM, Henry Baragar wrote: > > Hello, > > > > It occurs to me that the "timestamps" directive in Rails would have > > a corresponding "userstamps" in hobo that would include: > > • created_by: belonging to user set upon creation > > • updated_by: belonging_to user and set upon update > > because Hobo adds a user model to the Rails framework. This would > > make the timestamps much more useful, IMHO. > > Regards, > > > > Henry > > > > > > Henry Baragar > > Instantiated Software > > -- Henry Baragar Instantiated Software --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
