[LRUG] Clearance: problems with equivalence of #current_user
Max Williams
toastkid.williams at gmail.com
Tue Apr 21 07:31:46 PDT 2015
is it any different if you use triple-equals rather than equals? This is a
custom "equivalent" operator which each class can define for itself. It
may be more likely to accept that two different objects made from the same
record are in fact the same thing.
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/d304fcbd/attachment-0003.html>
More information about the Chat
mailing list