New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
undefined method `klass' for nil:NilClass #1183
Comments
Desactivate RailsAdmin until your ActiveRecord relations are properly set. |
Thank you for this hint. I think it'll repair it :) |
@bbenezech could you elaborate a bit more on what it means to have the "ActiveRecord relations properly set", I'm also experiencing this and it's unclear as how to proceed. |
@bbenezech hey, it's the same for me as with @kellydunn could you give some hints of what would be necessary to check? My associations are working. Thanks in advance! |
@kellydunn @gabrielosorio |
Thanks! It was an issue with a has_many/through association. In my case the class_name was wrong on one of the sides. Cheers! |
…tes !!!. Refaire toute la base et pour le bug de rails_admin: railsadminteam/rails_admin#1183
Just in case someone finds this on Google like I did, my issue was a
|
Since this is a associations error. I fixed this by moving all my_model.rb files (except user.rb) out of the /app/models/ folder into a ~/Desktop/Temp_Folder/ Therefore ActiveRecord can't complain about what files are not there. NOTE: After process this is complete make sure you move all your model.rb files back to /app/models/ folder. This is a work around it is better advised that at some point you fix your associations. |
I had an association in another model that wasn't configured properly on the model it was associated to, solved this, and the error in RA went away. Thanks. |
Just hit this. It would be great to catch this error and report "You may have an invalid assoication in " error instead. |
If there is one thing rails admin has taught me, it is that I'm bad at Associations. During this project, Rails_Admin has been like the canary in the coal mine and there are several commits that have laid claim to "fixing associations". |
+1. A complete message could be "Association :foo for model Bar is invalid/incomplete. Ensure it's well configured in both parts of the association, including :foreign_key, :class_name and :inverse_of options." |
I got this error on
rails_admin-0.0.3/app/views/rails_admin/main/index.html.haml where line #13 raised:
The text was updated successfully, but these errors were encountered: