Displaying 1 result from an estimated 1 matches for "usertimestamp".
2006 Mar 26
5
How to write manage created_on and created_by via mixin?
...hat dynamically
discovers the column names and sets it up. In Ruby, I''m totally lost.
However, I hold out hope - I just don''t know the terminology for what I''m
looking for since what I''m doing has to be relatively common.
So, I''ve created a mixin called UserTimestamp.rb:
module UserTimestamp
def mark_created
self.created_on = Time.new
self.created_by = @user.user_id
end
def mark_updated
self.updated_on = Time.new
self.updated_by = @user.user_id
end
end
And, then I include it and setup the before_create and after_create macros:
require...