Hello, I was wondering if (just like created_at/modified_at) it would be possible to somehow make a generic "created_by" / "modified_by" mechanism. Ofcourse, this could imply that a users table is present and that created_by acts as an user_id (and that an user is logged in while creating/modifying objects). Any thoughts on this? --- Jeroen Janssen
Jeroen Janssen wrote:>Hello, > >I was wondering if (just like created_at/modified_at) it would be possible >to somehow make a generic "created_by" / "modified_by" mechanism. > >Ofcourse, this could imply that a users table is present and that created_by >acts as an user_id (and that an user is logged in while creating/modifying >objects). > >Any thoughts on this? > > >I was looking at this last week and have been waiting for some free time to turn it into a blog post. My thoughts were that it could be a useful addition to the [salted] login generator. It''s trivial to add in by extending ActiveRecord and tying it in with whatever user management you have built into your app (whether it be the login generator or home grown). (details on the wiki: wiki.rubyonrails.com/rails/show/ExtendingActiveRecordExample) -- R.Livsey livsey.org
> [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] Namens Richard Livsey > > >I was wondering if (just like created_at/modified_at) it would be > >possible to somehow make a generic "created_by" / > "modified_by" mechanism. > > > >Ofcourse, this could imply that a users table is present and that > >created_by acts as an user_id (and that an user is logged in while > >creating/modifying objects). > > > >Any thoughts on this? > > > I was looking at this last week and have been waiting for > some free time to turn it into a blog post. > > My thoughts were that it could be a useful addition to the > [salted] login generator.Ok, I haven''t looked at the login generators yet, so I''ll have to do that first and see how those work.> It''s trivial to add in by extending ActiveRecord and tying it > in with whatever user management you have built into your app > (whether it be the login generator or home grown). > > (details on the wiki: > wiki.rubyonrails.com/rails/show/ExtendingActiveRecordExample)Thanks for the info. I''m really new to this (Ruby and Rails) and there are lots of different things I want to look into, but this sounds like something that should be (generic enough to be) useable by other people too. Bye, Jeroen Janssen