Re: Login controller additions: SOLUTION

Jarkko Laine
Thu, 10 Mar 2005 16:25:11 -0000

On 10.3.2005, at 18:17, Jonas Montonen wrote:
>
>  Well... after som testing my solution did not work after all... but
> Jarkko''s did.
>  Great!
>
>  @session[''user''].roles.collect{ |role| role.id
}.include?(1)

The reason is that the roles array consists of role objects, not id''s.
It might still work if Role objects had a to_int method that would
return their id, but I don''t know if that''s the case.

//jarkko


--
Jarkko Laine
http://jlaine.net
http://odesign.fi



_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org