[LRUG] Clearance: problems with equivalence of #current_user

David Salgado david at digitalronin.com
Tue Apr 21 07:17:48 PDT 2015


I'm sure you've already thought of this, but is there any way equivalence
of the User class (or whatever) could have got screwed up?

i.e. is this true?;   User.find('bob') == User.find('bob')

David



On 21 April 2015 at 15:14, Tom Armitage <tom at infovore.org> wrote:

> So I'm working on a project using Clearance for authentication, and Pundit
> for authorization/permissions. I'm particularly enjoying working with
> Pundit.
>
> However, I'm running into an issue on the front-end that I don't run into
> in my tests: whenever I ask if #current_user is include?ed in the list of
> users who have permission to do a thing, I inevitably get 'false' back -
> even if they're on that list. By contrast, the moment I ask if
> current_user.id is in users.map(&:id) - well, that works fine.
>
> So it feels like there's an issue around equivalence, which makes a bit of
> sense, but I have no idea why; all the Clearance docs suggest I can just
> use current_user as and when.
>
> Any thoughts or advice? I hope that came over as clear enough.
>
> Best,
>
> t.
>
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> Archives: http://lists.lrug.org/pipermail/chat-lrug.org
> Manage your subscription: http://lists.lrug.org/options.cgi/chat-lrug.org
> List info: 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/20150421/3180db24/attachment-0003.html>


More information about the Chat mailing list