I am trying to use rails_admin_pundit to add role based access to rails_admin.
I am getting this error when I click on the users table in the rails_admin.
ArgumentError at /user. User(id: integer, email: string, ... 'shortened' ...role: integer) is not an ActiveRecord::Relation
I created an app using:
https://github.com/RailsApps/rails-devise-pundit
and followed the usage instructions at:
https://github.com/sudosu/rails_admin_pundit
This is in my user_policy.rb
just to get things started...
def rails_admin?(action)
case action
when :destroy, :new
false
else
@current_user.admin!
end
end
Attached are a couple apps with the error, and a screen shot of what I see just before I press the Users model name link.
another app with the same error
Not needed: dropbox link... link to screenshot, error page, and two apps that I have this problem in...
- I can get pundit to work outside of rails_admin
- I am logged in as admin
- I have googled the web for this error or similar issues.
Can someone help me with this?