cancan and inherited_resources overwriting collection

888 views Asked by At

I think I am running into a conflict with two of my favorite gems. Consider the following:

class AccountsController < InheritedResources::Base
  load_and_authorize_resource

  def collection
    @accounts ||= end_of_association_chain.order_by(:name.asc).paginate(:page => params[:page],:per_page =>10)
  end

end

It does not seem the CanCan calls the collection method. I feel that it should.

Is there a known work around? Am I doing something silly?

Thanks!

1

There are 1 answers

0
Jonathan On BEST ANSWER

It seems after lengthy discussion -- that this will not be supported. Check out this thread for reasoning and work around: https://github.com/ryanb/cancan/issues/274#comment_888081