[LRUG] I know that this won't be welcome, but...
Capron, Stephen
s.capron at progressive.co.uk
Tue Aug 7 07:32:21 PDT 2007
I am looking very hard for FIVE RoR Developers on a Permanent Basis. The spread of experience can be large, and there is flexibility for the start date too.
My Client are an affiliate marketing Company based in N London.
They are willing to pay upto £60,000 along with excellent Benefits.
Please drop me a line if you would like to hear further detail, and we can talk immediately.
Many thanks (and apologies)
Stephen Capron
Senior Consultant
Business Intelligence & Analytics
Progressive
Tel: 020 8971 8787
mailto:s.capron at progressive.co.uk
To view the Progressive E-Brochure visit http://www.progressive.co.uk/docs/eBrochure/Progressive_ebook.pdf
To view a selection of our available Candidates visit http://www.progressive.co.uk/resumes
Or to view our full range of Client and Candidate facilities go to http://www.progressive.co.uk
-----Original Message-----
From: chat-bounces at lists.lrug.org [mailto:chat-bounces at lists.lrug.org] On Behalf Of Daniel Lucraft
Sent: 07 August 2007 15:24
To: London Ruby Users Group
Subject: Re: [LRUG] Setting default roles in a user record
--- John Winters <john at sinodun.org.uk> wrote:
> I thought I'd solved it by adding the relevant code
> to the
> after_initialize callback in the User model, like
> this:
>
> def after_initialize
> for role in Role.find(:all)
> if role.default_value
> self.roles << role
> end
> end
> end
>
> but although that seemed to work correctly I
> realised after a while that
> the roles were being added every time a user record
> was accessed, not
> just when the user was first created.
Then how about this?
def after_initialize
unless self.id
for role in Role.find(:all)
if role.default_value
self.roles << role
end
end
end
end
best,
Dan
_______________________________________________
Chat mailing list
Chat at lists.lrug.org http://lists.lrug.org/listinfo.cgi/chat-lrug.org
Search for CVs on-line or sign-up for jobs by email at: http://www.progressive.co.uk
This electronic transmission is confidential and intended solely for the
addressee(s.) If you are not an intended addressee, you must not
disclose, copy, distribute or take any action in reliance upon this
transmission. If you have received this transmission in error, please
notify Progressive Ltd.
You can find our privacy statement at http://www.progressive.co.uk/privacy.html
If you do not want to receive electronic mail from us about our services,
or would like to confirm or qualify how your personal data is held by us,
please send a request via email to data-audit at progressive.co.uk
More information about the Chat
mailing list