-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Polymorphic association problem #370
Comments
This seems to be because in polymorphic_association.rb the following method expects a parent_model inspecting my association this is nil |
I was able to reproduce by commenting out all It's still is a bug though. RailsAdmin shouldn't throw exception when no parent models are defined in polymorphic associations. |
No in the two models associated with calendars I have
I have no "has_many :calendars, :as => :organisable?" associations. Hope this helps and isn't too difficult a bug to squash. Thanks |
Thank's for the info, I'll add a polymorphic has_one to dummy app and try to fix it soonish. |
having the same issue, let me know if you need more info |
c948fe7 should fix this one. Besides supporting polymorphic has one associations in the child model (the belongs to side of association) that commit also hides the association in edit views for the parent models. This was due to the fact that AbstractObject would need specialized polymorphic update handling which is not implemented. Should we try to implement a form input for the parent as well? |
I'm seeing this same problem with rev b4a50b2. The classes involved look like,
The trace is:
Viewing Users crashes as described. Viewing Teams works fine, as do other polymorphic references in our code. The references themselves are never editable, but that's fine by me: I just need to edit other fields on the user. |
I have the same problem as billkauf. I think this bug should be reopened. |
I'm also seeing this bug. It throws exceptions on both:
As my key models |
As well, seeing this failure when doing 'Export Selected' from the list view on a single instance of an Inventory:
How come this hasn't been re-opened? |
Sorry, hadn't noticed the activity in this thread... |
I've done a bit of work on this. Can you guys retry with latest HEAD and tell me what happens? |
It stopped crashing for me as of snagging HEAD this weekend. So, not sure if it was a fix in the Export or if I got an early look at your changes. |
Ok I close it then. Thx for feedback. |
When viewing a model that has a polymorphic association (via belongs to) I am getting the following problem:
trace is
I'm sure this used to work fine in earlier versions of rails_admin :(
The text was updated successfully, but these errors were encountered: