[LRUG] Setting default roles in a user record

Tim Cowlishaw tim at timcowlishaw.co.uk
Tue Aug 7 08:09:36 PDT 2007


aah, I see your point. Thanks!

cheers,
Tim

On 8/7/07, John Winters <john at sinodun.org.uk> wrote:
>
> Tim Cowlishaw wrote:
> > Hmm... thinking about it, wouldn't after_create do the job? i'm assuming
> > that after_initialize  is called whenever a new object of that class is
> > instantiated, whether through a new(), find() or whatever method on the
> > model. after_create is called after a new object of that class is
> > created through new().
>
> As far as I can see from the documentation, after_create is invoked only
> *after* the record has been saved to the d/b.  This is quite late in the
> proceedings and too late to have the desired effect.
>
> I want the new user record to appear on screen ready for editing with
> the two default roles already ticked.  That way the operator can choose
> to un-tick them if they're not appropriate.
>
> I could almost do it with before_create, but it would mean things were
> happening behind the scenes which the operator didn't know about - not
> good.
>
> John
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20070807/0b0b1b63/attachment.html>


More information about the Chat mailing list