Rails Admin was working fine until I installed Devise_Invitable. Now, when I click on Users in Rails Admin I get the following error:
NoMethodError in RailsAdmin::MainsController#list
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.map
The other models work fine.
I have a hunch that this might be part of the trouble:
https://github.com/sferik/rails_admin/issues/370
as this is part of the devise_invitable
belongs_to :invited_by, :polymorphic => true
It says the issue is fixed but is there any way I don’t have the most recent rails admin?
gemfile
gem 'rails_admin', :git => 'git://github.com/sferik/rails_admin.git'
Thanks for any ideas.
The answer that has you add
has_many :invitees, :class_name => self.class.name, :as => :invited_byto the User model works to get rails_admin working, but I ran into problems deleting and editing. The solution is to change the line you add to the User model to: