ryanb/cancan — Issue #510: can? doesn't work with presenters
Author: denis-bu
Created: 2011-11-10 19:46:15+00:00
State: open

Hi!
I'm using this wonderful gem in my project and it turns that ```can?``` cannot handle presentrs (I use Draper gem) in my view. Consider:

<% if can? :update, @order%>
<%= link_to "Update", edit_order_path(@order)%>
<% end %>

So, since ```@oreder.class -> OrderDecorator``` this stuff doesn't work as I expect. It turns out ```can?``` lookups abilities by ```subject.class```.

I've workaround this with ```@order.model```, but it would be great if ```can?``` could do it automatically.

Thanks in advance.