Problem with scopes

8 views
Skip to first unread message

Matt

unread,
Feb 13, 2012, 3:41:20 PM2/13/12
to cantango
Hi, I'm testing out some basic access rules and trying to use a permit-
based scope in my index action. It seems like I should be able to use
something like Consumer.readable_by(current_user), but the SQL that is
called includes this bit: consumer_id` = 'read_attr_#{name}', which of
course doesn't match anything. It seems to be building the query
incorrectly, but I can't find any reference to 'read_attr_' in the
source.

In another attempt, I tried to use the accessible_by method from
CanCan to make a scope, but I'm not sure how to access that using
CanTango. I'd really appreciate some help with either of these issues.
Thanks!

Kristian Mandrup

unread,
Feb 14, 2012, 11:30:17 AM2/14/12
to cant...@googlegroups.com
Im on skiing vacation in Serbia.Will look into it when I get back, after the 21st

Lupu Alexandru Emil

unread,
Feb 14, 2012, 11:53:40 AM2/14/12
to cant...@googlegroups.com
Hello!

Try to gimme a snippet, I might be able to help you ... i do not guarantee, but ...

A
PGP.sig

Kristian Mandrup

unread,
Feb 16, 2012, 7:51:34 AM2/16/12
to cant...@googlegroups.com
Look at spec/cantango/model/scope_spec.rb
Reply all
Reply to author
Forward
0 new messages