activeadmin / activeadmin

The administration framework for Ruby on Rails applications.

Home Page:https://activeadmin.info

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

scoped_collection (accessible_by) issues with cancan since 0.3.3, 0.3.4

semarco opened this issue · comments

With ActiveAdmin 0.3.3 and 0.3.4
overwriting #scoped_collection to allow CanCan to return a accessible collection scope
is not working anymore since 0.3.3
( development environment )

I use the following snippet:

ActiveAdmin.register Event do
  controller do
    load_and_authorize_resource :except => :index
    def scoped_collection
      end_of_association_chain.accessible_by(current_ability)
    end
  end
end

A fresh hit to the server always returns the correct collection, the next reload the collection is empty!
If I force to reload ActiveAdmin (editing a admin/xxx.rb), the first hit returns the correct authorized collection, all followings requests are empty again.
So I guess there this problem is related to the new reloader feature.

With cache_classes = true, production env or ActiveAdmin 0.3.2 everything works perfectly.

Any one else has this issue?
Any workaround so far?

Thanks a lot!

Marco

I have the same issue. I'm looking forward to any workaround. Till then, I'll be using the 0.3.2.

same problem too

I am hitting this issue as well. Does 0.3.2 fix the problem? I haven't looked to see what I lose by going backwards. However, since this issue is blocking me, I'll have to revert and see if 0.3.2 is viable.

yep, going back to version 0.3.2 "solves" this problem

confirmed, reverting to 0.3.2 solved this problem. looking forward to a fix in a future release.

I have CanCan working fine with the latest AA from GitHub. See https://gist.github.com/3040303